Skip to main content

Secure encryption/signature library for client-server systems

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.3.tar.gz (6.3 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.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patriotlib-0.1.3.tar.gz
  • Upload date:
  • Size: 6.3 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.3.tar.gz
Algorithm Hash digest
SHA256 368620ffef3c4ea38e32e9afabc2a6c6cdcb166f376f77fa41c4b25c0a2f752a
MD5 23dcab25b537c8d53a950113ed44778c
BLAKE2b-256 855060b643481b7463ccbfc4df29a21a1859061ab546e3b89b706dc5937e8621

See more details on using hashes here.

File details

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

File metadata

  • Download URL: patriotlib-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3a92cb6a6476160c9619151d8e938834dd9dd96b90c7df4834b87be006eec9fe
MD5 03d27f1141deed014ec1c549e147d72c
BLAKE2b-256 107d17c25ddd26d145093a499d20bbeeb2449e2731802a9928a8622b039b993e

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