Skip to content

Our application aims at solving the problem of electricity meter systems by automating the bill generation process by fetching the meter readings from each customers associated meter, generating a monthly bill and sending it out to each and every customer, which they can access through a web portal.

aditya196/Secure-Communication-Channel-For-IOT-Devices

Repository files navigation

GitHub Logo

Secure Communication Channel for IoT Devices

Overview :

In todays world, with tedious manual tasks getting automated, several parts of india still find people physically going from house to house noting down electricity meter readings to generate bills. The main disadvantage of this task is that, it may lead to human errors and inaccurate readings or bill generations. In some cases, people even have to travel to remote locations for this purpose.
Our application aims to solve this problem by automating the bill generation process by fetching the meter readings from each customers associated meter, generating a monthly bill and sending it out to each and every customer, which they can access through a web portal. The main advantage of this application is that the bills generated are accurate, reliable and error-free. The customer can they pay the bill via their preferred method of payment. The application also contains a feature where the customer can raise a complaint with the system administrator. The user can track the status of his complaint. On resolving the issue, the system administrator marks the status as completed.
The primary motivation for this application stemmed from an interest in trying to create a secure communication channel for IOT devices to communicate on.

Main App Landing Page

Requirements :

  • Operating System
    • Ubuntu 16.04 +
    • Windows
  • Database
    • PostgreSQL
    • Redis
  • Browser
    • Chrome
    • Firefox
    • Opera
    • Safari

Setup :

sudo apt-get install libpq-dev 
virtualenv -p python3.6 venv  (If venv not present) 
sudo pip3 install -r requirments.txt 
sudo pip3 install -r dev_requirments.txt 
pip install gunicorn

Enter the Virtual Environment :

. venv/bin/activate

Final Step :

gunicorn --bind 0.0.0.0:5000 app:app

STEPS TO RUN PROGRAM (Environment Variables):

  • export FLASK_APP=app.py
  • export FLASK_DEBUG=1
  • export PYTHONDONTWRITEBYTECODE=1

Security Parameters Considered :

  • Authorization
  • Authentication
  • Integrity
  • Confidentiality

Algorithm's Used:

  • Elliptic Curve Integrated Encryption Scheme (ECDH + AES (ECIES)
  • Elliptic Curve Diffie-Hellman (ECDH)
  • AES-256 with CBC-Mode
  • Elliptic Curve Digital Signature Algorithm (ECDSA)
    • Curve Used - Secp256k1
  • SHA-256

Working :

The Project comprises of two main endpoints.

  • User
  • Admin
The functions of the project are as follows :
  • Registration :
  • The user and admin can sign up with the system by providing basic details of himself and has to verify his email address as well as mobile number through an OTP.
    
  • User Details Verification :
  • The admin on receiving the details of the user verirfies it,  and can even reject the user’s request. On being verified, the user is administered an IOT Device which gets activated and starts recording the electricity units. 
    
  • Lease out Properties :
  • The user has provisions to lease out his property (either commercial or residential) to tenants and add the tenants name as well to the property details. The user can delist the tenants name from the property details as and when required. The tenant too, has provisions to leave the property and delist himself. 
    
  • Billing :
  • To generate the monthly bill, the admin on the main server side sends a bill generation request to an IOT Server. The IOT Server then forwards the request to every IOT Device under in an asynchronous manner. The IOT devices send the current  units to the IOT Server, which then forwards it back to the main server where the bill is generated.
    
  • Setting Cost Per Unit for Billing(Admin) :
  • The system has the feature of setting the cost per unit and taxes or miscellaneous costs for commercial and residential usage respectively.
    
  • Support Query :
  • In case of any queries/complaints the user can raise the complaint with the admin and the system generates a ticket. The admin on receiving the complaint/query works towards resolving it. 
    

Features

  • Login using email i.e. password-less login.
  • Multi Factor Authentication
    • SMS OTP
    • Email Verification
  • Secure storage of passwords and sensitive user information
    • Password Format :- pbkdf2:sha256:50000$salt$hash
      • SHA256 - HAshing Algorithm
      • Number of Iterations : 50000
      • Salt Length : 16
  • Customised bill generation
  • Tracking payment status and generation of defaulters
  • Support query
  • Secure transmission of data between devices and server by encryption and authenticating the data
  • Prevention of malicious data entering system using [Cerberus](https://docs.python-cerberus.org/en/stable/)
  • Sanitisation of data through forms
  • Use of flask-limiter for preventing DoS [Flask-Limiter](https://flask-limiter.readthedocs.io/en/stable/)

Tools and Technology Overview :

  • Backend Technologies
    • Python Flask
  • Python Libraries
    • Cerberus
    • Celery
    • ecdsa
    • Pycryptodome
    • Flask-Limiter
    • Werkzeug.security
    • Base64
    • Hashlib
    • bcrypt
    • requests
    • flask-Sqlalchemy
    • flask-login
    • flask-mail
    • secrets
    • datetime
    • json
  • Frontend Technologies
    • HTML
    • CSS
    • Bootstrap 4
    • Jinja2
  • Databases
    • PostgreSQL
    • Redis

USER SIDE

User Signup User Signup

User Login User Login

User Dashboard User Dashboard

User Add Property User Add Property

User Property Validate User Property Validate

View Rented Properties View Rented Properties

View Owned Properties View Owned Properties

Support Query Support Query

ADMIN SIDE

Admin Login Admin Login

Admin Dashboard Admin Dashboard

Assign Server and Device to User Assign Server and Device to User

Assign Cost per Unit for Commercial as well as Residential Property Cost Per Unit

Assign Taxes Assign Taxes

Assign Miscellaneous Costs Assign Miscellaneous Costs

Sample Generated Bill Sample Generated Bill

About

Our application aims at solving the problem of electricity meter systems by automating the bill generation process by fetching the meter readings from each customers associated meter, generating a monthly bill and sending it out to each and every customer, which they can access through a web portal.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published