Sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) Here is the code for my server (please note: my computer is currently acting as both server and client): import socketįrom import rsa, paddingįrom import serialization, hashesįrom import default_backendĬontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)Ĭontext.load_cert_chain(certfile="server.crt", keyfile="server.key") I’ve tried to edit the code, changing the key size and the size of the sent data, but the error remains. Here is my full errorĭecrypted_chunk = private_key.decrypt( File “/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/rsa.py”, line 422, in decrypt raise ValueError(“Ciphertext length must be equal to key size.”) ValueError: Ciphertext length must be equal to key size.` I’ve got STL/TLS to work, and now I’m working on end-to-end encryption. ![]() ![]() I’m trying to make an end-to-end encrypted messenger in Python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |