Confy Addons
Implementation of symmetric and asymmetric encryption with AES and RSA algorithms for client applications of the Confy communication system.
A Python package that provides symmetric and asymmetric encryption functions for client applications of the Confy encrypted communication system, as well as prefixes that identify messages and encryption keys sent by applications during the handshake process. The package also includes functions to encode and decode the public RSA key to base64 for sending over the network.
Learn more about the project at github.com/confy-security
Made with dedication by students from Brazil 🇧🇷.
⚡ Using
Install the package
Install the package with the package manager used in your project.
For example, with pip:
pip install confy-addons
Or with Poetry:
poetry add confy-addons
Usage example
Import the necessary classes
from confy_addons import (
AESEncryption,
RSAEncryption,
RSAPublicEncryption,
deserialize_public_key,
)
This imports all the encryption classes and utilities needed for RSA and AES operations.
Generate an RSA key pair
rsa_handler = RSAEncryption()
private_key = rsa_handler.private_key
Creates a new RSA encryption handler that automatically generates a 4096-bit key pair. The private key is extracted for later decryption operations.
Serialize and share the public key
pub_key_b64 = rsa_handler.base64_public_key
deserialized_pub_key = deserialize_public_key(pub_key_b64)
The public key is serialized to a base64-encoded PEM format, which can be safely transmitted over text-based protocols. The deserialized version is reconstructed from the encoded string for encryption operations.
Create an RSA public encryption handler
rsa_public_handler = RSAPublicEncryption(key=deserialized_pub_key)
Initializes an RSA encryption handler using only the public key. This handler can encrypt data that only the holder of the private key can decrypt.
Generate and encrypt an AES key
aes_handler = AESEncryption()
encrypted_aes_key = rsa_public_handler.encrypt(aes_handler.key)
Generates a random 256-bit AES key and encrypts it using RSA public key encryption. This allows secure transmission of the symmetric key to the recipient.
Decrypt the AES key with the RSA private key
decrypted_aes_key = rsa_handler.decrypt(encrypted_aes_key)
aes_handler_decrypted = AESEncryption(key=decrypted_aes_key)
Decrypts the AES key using the RSA private key. A new AES handler is created with the decrypted key for symmetric encryption and decryption operations.
Encrypt and decrypt messages with AES
secret_message = "Secret message"
encrypted_message = aes_handler.encrypt(secret_message)
decrypted_message = aes_handler_decrypted.decrypt(encrypted_message)
print(decrypted_message)
Encrypts a plaintext message using AES-256 in CFB mode and then decrypts it back to verify the process works correctly. The output will display the original secret message.
Dependencies
Confy Addons relies only on cryptography.
Contributing
If you would like to contribute to the project, see more information at CONTRIBUTING.md.
License
Confy Addons is open source software licensed under the GPL-3.0 license.
Metadata
Release files for confy-addons 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| confy_addons-1.2.0.tar.gz | 22.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| confy_addons-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.6 kB
Release files / confy_addons-1.2.0.tar.gz
| Download URL | confy_addons-1.2.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cdfb7ff7e2a354aae912e11acd915fcbdc0fe560e8ca211613700512ec1b6cf
|
|
BLAKE2b-256 checksum How to use checksums |
d03809229b8468a40746c6c1ea0c5ab580bd808c7968f4739cb353ca5828c401
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2025.
Transparency logRelease files / confy_addons-1.2.0-py3-none-any.whl
| Download URL | confy_addons-1.2.0-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41168d71ea394253c491c0c15d3f401497d15284fa2ace8fe07e5875321a9684
|
|
BLAKE2b-256 checksum How to use checksums |
cc6baac8be48a39bb6ffb5df47ca060a8de28459ef3b4c422ee1673018908b77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2025.
Transparency log