Dynamic encryption key changer for security
Project description
Dynamic_enc is a package which uses rolling encryption key.
Installation
$ pip install dynamic_enc
How it works
Consider two keys and for our convenience let's consider them as previous key and current key
The encrypter returns an encrypted string of three parameters
- hashed Current key encrypted by previous key
- New key encrypted by previous key
- Data(needs to be sent) encrypted by New key
The whole string is encrypted in current key
eg . '1,2,3' (these 1 ,2, 3 are the above list)
Methods
- You have to initialize the module with your custom previous and current key eg.
object = dyno_encrpter(key) #(Key must be an array)
- You can later reassign keys with
assign_key(keys)
encrypt(data)
This method is uses the method above to encrypt your datadecrypt(data)
This method is uses the method above to decrypt your dataget_current_keys()
Will return the current keys in usegenerate_key()
This method will help to generate keys( you can use it for initialization)
Examples
from dynamic_enc import *
keys = dyno_encrypter.generate_keys()
encryption_object = dyno_encrypter(keys)
encrypted_data = encryption_object.encrypt("Hello")
decrypted_data = encryption_object.decrypt(encrypted_data)
current_keys = encryption_object.get_current_keys()
print(encrypted_data,decrypted_data,current_keys)
Enjoy!!!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dynamic_enc-0.0.1.tar.gz
(3.6 kB
view hashes)