Encryption and Decryption codes transform plaintext in some way that is dependent on a key, producing ciphertext using by Python3.
PyCrypto
Before you encryption or decrytion something, must know two important values.
- Key: String, continous string values like password that will be converted by
UTF-8
- Initial Vector: String, 16 numbers
[0-9]{16}$
and wrap it with type of string
(example)
key = 'password1234~!@#$something'
iv = '1234567890123456'
from cipher.crypto import Cipher
data = 'Something you want to encrypt'
enc = Cipher(key, iv)
result = enc.encryption(data)
from cipher.crypto import Cipher
data = 'Something you want to decrypt'
dec = Cipher(key, iv)
result = dec.decryption(data)