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 details)
File details
Details for the file dynamic_enc-0.0.1.tar.gz
.
File metadata
- Download URL: dynamic_enc-0.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.7.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28e02e0613c3edd9bc299bb103d2278c721e65d20825fbf676f820959376cca4 |
|
MD5 | f8260419b3da3b9d8de2f1484bddcd7d |
|
BLAKE2b-256 | 587c6c8e3ece1cbe1d3f961e90278d2d38387325d49bd91a4ad67864b0a692df |