AesBridge is a modern, secure, and cross-language AES encryption library. It offers a unified interface for encrypting and decrypting data across multiple programming languages. Supports GCM, CBC, and legacy AES Everywhere modes.
This is the Python implementation of the core project.
👉 Main repository: https://github.com/mervick/aes-bridge
- 🔐 AES-256 encryption in GCM (recommended) and CBC modes
- 🌍 Unified cross-language design
- 📦 Compact binary format or base64 output
- 🐍 Pure Python with zero dependencies (except
cryptography
) - ✅ HMAC Integrity: CBC mode includes HMAC verification
- 🔄 Backward Compatible: Supports legacy AES Everywhere format
pip install aes-bridge
from aes_bridge import encrypt, decrypt
ciphertext = encrypt("My secret message", "MyStrongPass")
plaintext = decrypt(ciphertext, "MyStrongPass")
-
encrypt(data, passphrase)
Encrypts a string using AES-GCM (default).
Returns: base64-encoded string. -
decrypt(data, passphrase)
Decrypts a base64-encoded string encrypted with AES-GCM.
-
encrypt_gcm(data, passphrase)
Encrypts a string using AES-GCM. Returns: base64-encoded string. -
decrypt_gcm(data, passphrase)
Decrypts a base64-encoded string encrypted withencrypt_gcm
. -
encrypt_gcm_bin(data, passphrase)
Returns encrypted binary data using AES-GCM. -
decrypt_gcm_bin(data, passphrase)
Decrypts binary data encrypted withencrypt_gcm_bin
.
-
encrypt_cbc(data, passphrase)
Encrypts a string using AES-CBC. HMAC is used for integrity verification.
Returns: base64-encoded string. -
decrypt_cbc(data, passphrase)
Decrypts a base64-encoded string encrypted withencrypt_cbc
and verifies HMAC. -
encrypt_cbc_bin(data, passphrase)
Returns encrypted binary data using AES-CBC with HMAC. -
decrypt_cbc_bin(data, passphrase)
Decrypts binary data encrypted withencrypt_cbc_bin
and verifies HMAC.
-
encrypt_legacy(data, passphrase)
Encrypts a string in the legacy AES Everywhere format. -
decrypt_legacy(data, passphrase)
Decrypts a string encrypted in the legacy AES Everywhere format.