RES is a simple symmetric key encryption algorithm designed to encrypt using randomization. It uses a hashing algorithm to generate random numbers from the input key. Then it goes through 3 stages of ciphers before before using key block encryption. This algorithm uses 128, 256, and 512 char blocksizes
This code is available on PyPI under the name REScrypt
:
pip install REScrypt
Example For encrypting and decrypting using RES:
import RES
cipher=RES.Cipher("RES-128", b"key")
ciphertext=cipher.encrypt(b"buffer")
plaintext=cipher.decrypt(ciphertext)
print("Encrypted: ",ciphertext)
print("Decrypted: ",plaintext)
The code also has a built in function to encrypt and decrypt files using fencrypt()
and fdecrypt()
as well as outputing the encryption in hexadecimal using hencrypt()
and hdecrypt()
. Conviently I also combined them to encrypt and decrypt files with hexadecimal with hfencrypt()
and hfdecrypt()
.
MIT License, you all know what that is.