AES Class

For programmers to need to encrypt and decrypt data with AES by python,this tested source code is useful.

It is available to generate AES key and encrypt/decrypt text or binary data,files.

Specification

IDSTCD_0000000003
LanguagePython
Steps138
PurposeEncrypt and Decrypt data with AES.
FunctionEncrypt data with AES(CBC/CFB/OFB/EAX/GCM/CTR).
Decrypt data with AES(CBC/CFB/OFB/EAX/GCM/CTR).
EnvironmentAnaconda3(Python 3.9.7)
IDE : Visual Studio Code
PyCryptodome
Restrictionfree license
You can use source code copy as owner .
You can customize and distribute it freely.
Price7 dollars or 700 yen
(Pay with PayPal)
Referenceshttps://pycryptodome.readthedocs.io/en/latest/src/examples.html
https://docs.python.org/ja/3/library/hashlib.html
https://www.python.ambitious-engineer.com/archives/1069

https://telecom-engineer.blog/blog/2022/02/04/python-crypto-aes-ctr/

https://qiita.com/shimajiri/items/ffaf84280db257531437

https://en.wikipedia.org/wiki/EAX_mode

https://pycryptodome.readthedocs.io/en/latest/src/cipher/aes.html

https://telecom-engineer.blog/blog/2022/02/04/python-crypto-aes-ctr/

Source Code

Test Result

NOtest caseresult
01mode pattern test with text data
– Change aes encryption mode(CBC/CFB/OFB/EAX/GCM/CTR)
OK
02mode pattern test with binary data)
– Change aes encryption mode(CBC/CFB/OFB/EAX/GCM/CTR)
OK
03file pattern test
– text file and image file
OK

Test Code

*) Modify “path” along your PC environment.

History

20/11/2022 created

Provider Profile

Nick name is “Dead Fish” employed as an engineer in Japan.
I am grad if you need my code.
Thanks !

Download

Get download password

Following files and data are zipped.

├── AesClass.py
├── test_image.png
├── test_image_out.png
├── test_text.txt
└── test_text_out.txt

Remarks

None

Comments

Copied title and URL