Nowadays every infrastructure work smartly as smart home, smart industry, smart academia etc. They use various smart IoT (Internet of Things) devices those charged by electricity. These electricity usage report is recorded by smart meter and then it send to the billing office wirelessly for payment that is given by users. These electricity bill rates vary depending on the environments those use it as household, industrial purpose etc. But there are several questions we need to be consider as: how much these energy or data is transferred securely?, how these smart devices are authorized?, how to make this system cost efficient and usage of electricity more appropriately so,that accurate electricity bill is generated or paid by the users without corruption? For resolving all of the above issues, We develop SS EMS :A Smart and Secure Framework of Energy Management System that uses blockchain technology for security features along with IoT devices and Machine Learning(ML) or Deep Learning (DL techniques) for the prediction of usage of electricity at these smart infrastructure along with two new ideas for these system as: 1. A new methodology for billing payment specifically for IoT or smart devices. 2. Securely selling or buying energy (Solar, Biomass etc.) directly between each other smart infrastructure for easier exchange of energy.