Skip to main content

Secure async crypto library with AES-256, HMAC, ECDSA, ECDH, replay protection

Project description

PatriotLib 🇷🇺

📦 PatriotLib — это библиотека криптографической защиты, разработанная для защищённой передачи, подписи и расшифровки данных в клиент-серверной архитектуре.

Возможности

  • AES-256 (CBC + HMAC-SHA256) для симметричного шифрования
  • Поддержка ECDH для безопасного обмена ключами
  • Подпись и проверка сообщений (ECDSA P-384)
  • Защита от replay-атак через nonce
  • Полное покрытие юнит-тестами

Установка

pip install patriotlib

Пример использования

Example

from patriotlib.crypto import encrypt, decrypt
from patriotlib.keyexchange import generate_ecdh_keys, derive_shared_key

# ECDH exchange, derive shared key
client_priv, client_pub = generate_ecdh_keys()
server_priv, server_pub = generate_ecdh_keys()
shared_key = derive_shared_key(client_priv, server_pub)

# Encrypt / Decrypt
cipher = await encrypt(shared_key, b"Top Secret")
plain = await decrypt(shared_key, cipher)

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

patriotlib-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

patriotlib-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file patriotlib-0.1.0.tar.gz.

File metadata

  • Download URL: patriotlib-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for patriotlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 09834971154dd902e01c3280b6db7ad382afb0a0d6bf190ca5f227584ef59659
MD5 61d0a6056b3ce18f26da098b47a6e1e9
BLAKE2b-256 2d1356e57ae6837ffdf704eaa522238697f1ab38abd370a382c48acd63265202

See more details on using hashes here.

File details

Details for the file patriotlib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: patriotlib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for patriotlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47aa94e014ec23540ea451b888fb1c6d3a44cdc5d93340f1dc907f66729aaf2b
MD5 97be61395429ae37af52055111648997
BLAKE2b-256 c0aae46cb1d59e0a808c95904a72feea0f7aafde97d48b1088148a792bbbbdf0

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