# Decrypt the ciphertext using the private keyįor i in range(0, len(decoded_data), 256): Public_key = serialization.load_pem_public_key( Ssl_sock = context.wrap_socket(client_sock, server_side=True) Print("Connection established from", client_address) # Bind the socket to a specific address and portĬlient_sock, client_address = sock.accept() 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 error:Įrror: 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |