Module which helps in encryption and decryption
Project description
[cipher_kit] Module which helps in encryption and decryption
This module helps in Encryption and decryption.
Encryption Algorithm:
- Create list of unicode value of each letter of key (key_list).
- Iterate key_list (i).
- Multiple text[i] with key_list[i] and store somewhere (data).
- divide data by 2 and store remainder (remainder).
- Now append data and remainder in our encrypted data.
- Repeat this process until all data encrypted.
Decryption Algorithm
- Create a list of unicode value of each letter of key (key_list), index=0.
- Create a list of pair of text (text_list = [[data, remainder], ...]).
- Iterate text_list (i).
- Multiply first element of text_list[i] with 2
- Add second element of text_list[i]
- Now divide by key_list[index].
- Append decrypted text with unicode character of this value.
- Increment index by 1 and set to 0 if index >= length of key_list.
- Repeat this process until all data decrypted.
Usage
How to import
from cipher_kit import Cipher
To Encrypt
data = "Data to be encrypted"
key = "Secret key"
encrypted_data = Cipher.encrypt(data, key)
To decrypt
encrypted_data: str
decryted_data = Cipher.decrypt(encrypted_data, key)
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
cipher_kit-0.0.3.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for cipher_kit-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 895faf363f540e4970cbd486cfaaf9b0cb09fd8ed31d5147f0d78e2565482771 |
|
MD5 | b2a6b69dba8e6affba08e2256fe31a7a |
|
BLAKE2b-256 | cde51b60fd04601da60b0d2564fb819324a662f9e771c19532e523ed9033905c |