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.2.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.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patriotlib-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 22f3807abaab9fb9e68f27d61f1c882db97fc6ee3a71981f28db2afb59daf806
MD5 df94342d32bcd8eb87c91f397ec0de48
BLAKE2b-256 24fc086f80cf30e8e15c0cc51f16ef00e6bae15297b62066140e322c4a14c08d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: patriotlib-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0aba2edbb5676553d5e56a955f9c60da15d161fc9f55a61157543b4d8ad26103
MD5 0fbca699cb83c21ec95b71fba1e07ed8
BLAKE2b-256 0c0f427821de2a71da522b1d91fb1759005715c530bd3c12004c60830ef39d85

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