Skip to main content

A socket library that facilitates communication between python client and server.

Project description

Libsocket

Principle

The idea behind this library is to facilitate the communication between python clients and servers. It will automatically make the connection, and has the ability to send and receive messages and files. The connection can optionally be encrypted using XOR cypher. The XOR key is exchanged securely with an RSA keypair provided by the server. The encryption protocol is inspired by the SSH protocol, and described below.

Encryption

Client

The client will send a special request to the server to ask for its public key for asymmetric encryption. The client will wait for the response from the server, and store the key sent in response by the server.

The client will then generate a random symmetric encryption key (a XOR key seems simple and efficient to me). It will encrypt the generated symmetric key with the previously received server's public key, and send the encrypted key to the server.

The server will then store the symmetric encryption key, and use it to decrypt and encrypt the messages during the communication process.

The client will have the ability to encrypt and decrypt the messages using the XOR key previously generated. The client can choose if it wants to encrypt the messages, however, once the key has been sent to the server, all the messages sent by the server to the client will be encrypted.

Server

The server will wait for a connection request. When a client will ask him for his previously generated public key, he will send it to the client, and wait for the sending of the symmetric key.

When it receives the symmetric key, it will save it and use it to encrypt all messages sent to the client. If a recived message is encrypted, it will be decrypted with this same key.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libsocket-1.31.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libsocket-1.31.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file libsocket-1.31.0.tar.gz.

File metadata

  • Download URL: libsocket-1.31.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for libsocket-1.31.0.tar.gz
Algorithm Hash digest
SHA256 6e4b6444a8030d99d5955d86fa498ff2d71f7a36a382528d4147385a61d4c5e5
MD5 b0e715e00527b3a2127e265265abf5d7
BLAKE2b-256 b6fcb1c553c787f783fda7c7e03027deffa15bf7606679cbbe46236ad72c45f2

See more details on using hashes here.

File details

Details for the file libsocket-1.31.0-py3-none-any.whl.

File metadata

  • Download URL: libsocket-1.31.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for libsocket-1.31.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7971f264368a5a5a3e0cd3a3145d388dd0e507fe5249caad9e67050c0b07c5b2
MD5 3c4d0e3f6dae4e40496c1d95b09d3ed0
BLAKE2b-256 7158f4f083b07fd48d2e94ff3faeef4954548f2990727f6198b9c304a7b1ec1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page