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.RSA_Light 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.0.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.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: RSA-light-iot-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 0713989445254565266952172fca57d30edcc71a094b37c57ea0ae84f2a87b0b
MD5 66e8450f0b8b9036667ec2b5e3cca4d6
BLAKE2b-256 8d813d1e2aa5921570889174728f4cf26901b41a0067e7756e866afa7362c6fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: RSA_light_iot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a15300e47298a6a5ae4805566f8ca25d6553b7218534569a05641cdab7cd8b4
MD5 d9c7b03d9c8791c7db5b32104359fea7
BLAKE2b-256 bcd406dad339fd0255665848e1302188ed67e7462c8d494289ef1ba647ceeb2d

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