Add Elliptic Curve and docs

This commit is contained in:
2026-02-15 09:14:59 +01:00
parent a8b05c2320
commit 66b5741b28
23 changed files with 2147 additions and 21 deletions
+27
View File
@@ -0,0 +1,27 @@
# Generating RSA Keys
In the following section, we are going to see how to generate RSA Keys and how to encrypt data with these keys.
```
#!/usr/bin/env python3
from Cryptotools.Encryptions.RSA import RSA
rsa = RSA()
rsa.generateKeys(size=512)
e = rsa.e
d = rsa.d
n = rsa.n
s = "I am encrypted with RSA"
print(f"plaintext: {s}")
encrypted = rsa.encrypt(s)
# Encrypt data
print(f"ciphertext: {encrypted}")
# We decrypt
plaintext = rsa.decrypt(encrypted)
print(f"Plaintext: {plaintext}")
```