Skip to main content

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

  1. hashed Current key encrypted by previous key
  2. New key encrypted by previous key
  3. 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

  1. You have to initialize the module with your custom previous and current key eg. object = dyno_encrpter(key) #(Key must be an array)
  2. You can later reassign keys with assign_key(keys)
  3. encrypt(data) This method is uses the method above to encrypt your data
  4. decrypt(data) This method is uses the method above to decrypt your data
  5. get_current_keys() Will return the current keys in use
  6. generate_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


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)

Uploaded Source

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

Hashes for dynamic_enc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 28e02e0613c3edd9bc299bb103d2278c721e65d20825fbf676f820959376cca4
MD5 f8260419b3da3b9d8de2f1484bddcd7d
BLAKE2b-256 587c6c8e3ece1cbe1d3f961e90278d2d38387325d49bd91a4ad67864b0a692df

See more details on using hashes here.

Supported by

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