Skip to main content

simes: Simple Encrypted Socket Library

Overview

simes is a Python library designed to facilitate secure and easy-to-use encrypted communication over sockets. It provides a suite of tools for encrypting and decrypting messages sent over TCP/IP, ensuring that your data remains private and secure during transmission.

Features

  • AES Encryption: Utilizes Advanced Encryption Standard (AES) in CBC mode for strong encryption.
  • Automatic Padding: Handles padding of messages to fit block size requirements.
  • IV Management: Securely generates and manages Initialization Vectors (IVs) for each encryption operation.
  • Key Management: Offers a simple interface for managing encryption keys.
  • Error Handling: Robust error handling for common issues like message size limits and unknown senders.
  • Socket Communication: Seamlessly integrates with Python's socket module for network communications.

Installation

To install simes, you can simply use pip:

pip install simes

Usage

Here's a quick example to get you started with simes:

Encrypting and Sending a Message

import socket
from simes import sendEncryptedJSON

# Setup socket and key
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
key = b'secret_key_16_byte'

# Encrypt and send a message
data = {"message": "Hello, World!"}
sendEncryptedJSON(sock, 'sender_name', data, key)

Receiving and Decrypting a Message

from simes import receiveEncryptedJSON

# Assuming 'sock' is a socket object

keys_dict	= {'sender_name': b'secret_key_16_byte'}

sender, data = receiveEncryptedJSON(sock, keys_dict)
print("Received message from", sender, ":" data)

Check the test directory for more examples.

Contributing

Contributions to simes are welcome!

License

simes is released under the MIT License.

Metadata

Release files for simes 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simes 0.1.4
File Size Uploaded Provenance Actions
simes-0.1.4.tar.gz 6.1 kB Without provenance Details for simes-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simes 0.1.4
File Interpreter ABI Platform Actions
simes-0.1.4-py3-none-any.whl Python 3 none any Details for simes-0.1.4-py3-none-any.whl

Total release size: 11.4 kB

Release files / simes-0.1.4.tar.gz

Download URL simes-0.1.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5f0288e1fbf9c1fe0c9656a0168fae5303776dec7fea3357430935b4fbb816b9
BLAKE2b-256 checksum
How to use checksums
ad3ac66b82d0e850c721b9f9f412e23896e54b7e8e6ad6319f694e87c3905595
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.5

Release files / simes-0.1.4-py3-none-any.whl

Download URL simes-0.1.4-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36cef172fbc5ca3153f5a513a5c3d8e098bd0861c5c21f2a37f2ccb3942b1809
BLAKE2b-256 checksum
How to use checksums
089d79cf52768930150b35432673c3449273a3df34be9d52f4959cbc42baf101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.5

Security for simes 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page