RSA Class

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

It is available to generate RSA key pair and encrypt by public key,decrypt by private key.
Also it is available to create and verify digital signature with various hash algorithm like md5/sha1/sha256/sha224/sha384/sha512,using private key and public key.

Specification

IDSTCD_0000000004
LanguagePython
Steps113
PurposeEncrypt and Decrypt data with RSA.
FunctionEncrypt data with RSA.
Decrypt data with RSA.
Create digital signature with RSA.
Verify digital signature with RSA.
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://ameblo.jp/namuyan/entry-12337764948.html
https://y0m0r.hateblo.jp/entry/20130607/1370616817
https://pycryptodome.readthedocs.io/en/latest/src/public_key/rsa.html
https://telecom-engineer.blog/blog/2022/05/02/python-rsa-padding/
https://www.dlitz.net/software/pycrypto/api/2.6/Crypto.Cipher.PKCS1_OAEP.PKCS1OAEP_Cipher-class.html#encrypt
https://qiita.com/kj1/items/aebbb73a034f36d73e40

Source Code

Test Result

NOtest caseresult
01encryption / decryption test with various key bit length.
– 1024/2048/3072 bit
OK
02creation test of digital signature with various hash algorithm.
– md5/sha1/sha256/sha224/sha384/sha512
OK
03max encryption data length test with various key bit length.
– 1024/2048/3072 bit
OK

Test Code

*) Modify “path” along your PC environment.

History

23/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.

└── RsaClass.py

Remarks

None

Comments

Copied title and URL