Skip to main content

A Python package to implement RSA Lightweight adapted for Public key Cryptography in IoT devices.

Project description

RSA Light for IoT

A Python package to implement RSA Lightweight adapted for Public key Cryptography in IoT devices.

Installation

Run the following

pip install RSA-light-iot

Usage

It is used in establishing secure communication channel using RSA by Key-exchange

Consider a key k to be exchanged over unsecured channel

Generate Prime numbers of minimum length of 32bits

Example Code

from RSA_light_iot import RSA_Light

key = "6UJ5lOU9ls1ialQ0xIyVkzO-Vg_uBKUDkzaL2Ip83fA="
print("Let the key to be exchanged is ", key)

SIZE = 32

rsa = RSA_Light(SIZE)
k_pub, k_prv = rsa.rsalight_keygen()
print("\nGenerating Public and Private keys.............")
print("\nThe Public keys are ", k_pub)
print("The Private keys are ", k_prv)

cip = []
cip_str = []
for k in key:
    asc = ord(k)
    cipher = rsa.rsalight_encrypt(asc, k_pub)
    cip.append(cipher)
    cip_str.append(str(cipher))

cipher = ''.join(cip_str)
print("\nThe Encrypted key using Public key\n", cipher)

message = []
for c in cip:
    msg = rsa.rsalight_decrypt(c, k_prv)
    message.append(chr(msg))

message = ''.join(message)
print("\nThe Decrypted key using Private key\n", message)

Pro Features

  • RSA algorithm utilizing three primes as against the standard RSA algorithm of two normal primes are utilized to improve the security.
  • Enhances the security of RSA algorithm by keeping it away from few attacks that are available on RSA algorithm like chosen cipher-text attack, common modulus attack, known plaintext attack, and timing.
  • Speed enhancement on the decryption side of RSA algorithm was introduced by utilizing the idea of Chinese remainder theorem.
  • Prevention from mathematical factorization attacks by making the process very hard to factorize it and get the original numbers.
  • Despite of a slight increase of time complexity, this modification makes the algorithm more secure.

Reference

Zaid, Mustafa & Hassan, Soukaena. (2018). Lightweight Rsa Algorithm Using Three Prime Numbers. International Journal of Engineering and Technology(UAE). 7. 293-295. 10.14419/ijet.v7i4.36.23790

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RSA-light-iot-1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RSA_light_iot-1.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file RSA-light-iot-1.0.1.tar.gz.

File metadata

  • Download URL: RSA-light-iot-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for RSA-light-iot-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a944effb46f82c2b6ae1110c5087ee7bdc6d53dcb9a9fe2ef407be69acb445b5
MD5 266fb9feb6b222e6b8e0f33f27845357
BLAKE2b-256 9032ced1f93b0dacb9a3bcdb9609a615760c53cff5c5418166bce60e506c8d8b

See more details on using hashes here.

File details

Details for the file RSA_light_iot-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: RSA_light_iot-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for RSA_light_iot-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70d3c66e5c117a60b44438f06613f2a82dc9b5cfd3686afe126caf169caaff1b
MD5 946b672576d9f5520135b9a8334e5ea7
BLAKE2b-256 c8d75b574e80b68d0872fac843ee319ec7efc009f6f2f118797f2f6f710dbb38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page