![]() ![]() ![]() The byte string ciphertext is converted to a character string by str() or at the latest by input().Įxample: The 2 byte string b'\x11\xed' is converted by str() or by input() into an 11 bytes character string like a UTF8 encoding reveals: b"b'\\x11\\xed'". If anyone knows why this is, I would love some help. Whenever I encode text and then paste it into the input of the decryption program, it returns cannot decode message. Return rsa.verify(message, signature, key, ) = 'SHA-1'Ĭiphertext = input("message to decipher: ") Return rsa.decrypt(ciphertext, key).decode('ascii') Print(f"public key: ")Įncryptme = input('Write your message here:')Ĭiphertext = encrypt(encryptme, publicKey)Īnd in the decryption file I have: import rsa Return rsa.sign(message.encode('ascii'), key, 'SHA-1') ![]() Return rsa.encrypt(message.encode('ascii'), key) With open('keys/privateKey.pem', 'rb') as p: With open('keys/publicKey.pem', 'rb') as p: With open('keys/privateKey.pem', 'wb') as p: With open('keys/publicKey.pem', 'wb') as p: (publicKey, privateKey) = rsa.newkeys(1024) In the encryption file I have: import rsa So I am trying to make two programs, one to encode a message using rsa encryption, and one to decode it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |