

The problem is neither related to encrypting or decrypting functions nor with saving the message in encrypted form. : Decryption failedĪlso the publicKey and privateKey are just publicKey, privateKey = rsa.newKeys(512) Raise DecryptionError("Decryption failed") Which is returning this error File "/passmanager/main.py", line 64, in įile "/passmanager/main.py", line 53, in decodeįile "/home/horia/.local/lib/python3.10/site-packages/rsa/pkcs1.py", line 281, in decrypt Passwords = Īnd then decrypting it with this function called decode() def decode(message_to_recieve):Įncrypted_b64 = message_to_recieve.encode()Įncrypted = base64.b64decode(encrypted_b64)ī_final_message = rsa.decrypt(encrypted, privateKey) I've saved the passwords in a text file and I'm taking them from the text file using this chunk of code if os.path.isfile('passwords.txt'): This is the code for the encryption def encode(message_to_send):Įncrypted = rsa.encrypt(b_message, publicKey)Įncrypted_b64 = base64.b64encode(encrypted)Įncrypted_b64_string = encrypted_b64.decode() What's not going smoothly is the decryption.

I'm trying to make a password manager with Python and encrypting the passwords with RSA.
