Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justscott/rapidrsa
Simpler to use implementation of the pycryptodome RSA algorithm
https://github.com/justscott/rapidrsa
asymmetric-cryptography cryptography encryption-decryption python3 rsa rsa-cryptography
Last synced: 9 days ago
JSON representation
Simpler to use implementation of the pycryptodome RSA algorithm
- Host: GitHub
- URL: https://github.com/justscott/rapidrsa
- Owner: JustScott
- License: mit
- Created: 2022-04-09T19:28:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-06T17:31:32.000Z (about 2 years ago)
- Last Synced: 2024-08-11T13:04:43.529Z (3 months ago)
- Topics: asymmetric-cryptography, cryptography, encryption-decryption, python3, rsa, rsa-cryptography
- Language: Python
- Homepage: https://pypi.org/project/rapidrsa/
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
RapidRSA
Simpler to use implementation of the pycryptodome RSA algorithm
# Example Use
```python
from rapidrsa import rsarsa = rsa()
e = rsa.encrypt("Example Text")
d = rsa.decrypt(e)
```Easily Create and Verify Signatures
```python
from rapidrsa import rsarsa = rsa()
e = rsa.encrypt("Example Text")
signature, digest = rsa.create_signature(message)
if rsa.verify_signature(signature, digest):
d = rsa.decrypt(e)
```Required Dependences From PyPi
pycryptodome >= 3.15.0
# Documentation
```python
'''
Classes:
rsa(key_size=2048, public_key=None, private_key=None)
Can be fully functional and secure without passing any arguments
Methods:
keygen(self, key_size: int) -> bytes and bytes
Generates Keys for Encryption/Decryption. The 'key_size' will determine the security
and speed of your data (bigger is more secure, but slower)
encrypt(self, data: str or bytes, public_key=None) -> bytes
Only requires a public key if you don't want to use the class generated key
decrypt(self, encrypted_text: bytes, private_key=None) -> str or bytes
Only requires a private key if you don't want to use the class generated key
create_signature(self, data: str, private_key=None) -> bytes and object
Creates a signature for later verifcation that the data hasn't been tampered
with during transport
verify_signature(self, signature: bytes, digest: object, public_key=None) -> bool
Verifies the signature of the data, ensuring the data hasn't been tampered with
generate_password(self, length=64) -> str
Generates a random password to share with the client/server for symmetric cryptography
'''
```