An implementation of Symmetric encryption of kriptaAES in python.
- Python (3.X)
- pycryptodome (install it with
pip install -r requirements.txt
)
First you need to copy/Paste the script KriptaAES to your project, and then install its dependencies by running:
# Add pycryptodome==3.9.0 in your requirements.txt file of your project
pip install -r requirements.txt
This is how it's work in the code:
# First you call the module KriptaRSA
from KriptaAES import KriptaAES
k = KriptaAES()
print("\nWELCOME TO KRIPTA-AES-PYTHON")
message = "Mon message Secret"
secret_key = "secret-code-password"
print("-----------------------------------------------------")
print("Message : ", message)
print("-----------------------------------------------------")
print("secret_key : ", secret_key)
print("-----------------------------------------------------")
encrypted_msg = k.encrypt(message, secret_key)
print("Encrypted-Message : ", encrypted_msg.decode('utf-8'))
print("-----------------------------------------------------")
print("Decrypted-Message : ", k.decrypt(encrypted_msg, secret_key).decode('utf-8'))
print("-----------------------------------------------------")
## You can also :
# encrypt/decrypt files with KriptaAES
# set a master_key
# sign a file
# Verify a file + some interesting methods :-)
## Consult the main class or contact the author for more informations.
This is what your code will return:
WELCOME TO KRIPTA-AES-PYTHON
-----------------------------------------------------
Message : Mon message Secret
-----------------------------------------------------
secret_key : secret-code-password
-----------------------------------------------------
Encrypted-Message : OyIdlFlruPcoFvcrwg424e8Sfa29KjGeUfof6NqI1Mxn29Ch5JO3obAHdLQ5CJM1bfXU4HlhtZZEQMcdlkth37mjEIJVdlwil6nOnoPF5I67O6A1Fv+IcvI21Xpw9nJs
-----------------------------------------------------
Decrypted-Message : Mon message Secret
-----------------------------------------------------
To test the Symmetric Enryption, you just need to run :
python example.py
- Sanix darker