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
Metadata
Release files for RSA-light-iot 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| RSA-light-iot-1.0.1.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| RSA_light_iot-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / RSA-light-iot-1.0.1.tar.gz
| Download URL | RSA-light-iot-1.0.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a944effb46f82c2b6ae1110c5087ee7bdc6d53dcb9a9fe2ef407be69acb445b5
|
|
BLAKE2b-256 checksum How to use checksums |
9032ced1f93b0dacb9a3bcdb9609a615760c53cff5c5418166bce60e506c8d8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / RSA_light_iot-1.0.1-py3-none-any.whl
| Download URL | RSA_light_iot-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70d3c66e5c117a60b44438f06613f2a82dc9b5cfd3686afe126caf169caaff1b
|
|
BLAKE2b-256 checksum How to use checksums |
c8d75b574e80b68d0872fac843ee319ec7efc009f6f2f118797f2f6f710dbb38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|