Skip to main content

Sanskrit-Encoded Post-Quantum Cryptography SDK

Project description

Abhedya: Sanskrit-Encoded Post-Quantum Cryptography

Unmatched Speed. Unbreakable Security.

Abhedya is a high-performance Post-Quantum Cryptography (PQC) library that implements a Lattice-based (LWE) cryptosystem with a unique capability: Linguistic Steganography. It can encode ciphertexts into valid, prosodically correct Sanskrit verse.

Features

  • Post-Quantum Security: Based on the Learning With Errors (LWE) problem ($N=768, Q=3329$).
  • Sanskrit Steganography: "Metered Mode" produces ciphertexts that follow classical Anushtubh meter (Sloka).
  • High Performance: Sub-microsecond encryption (<1ms) via optimized Rust core.
  • Cross-Platform: Python bindings for the core Rust implementation.

Installation

pip install abhedya

Note: This package requires a compatible C runtime (provided in wheels for Linux/macOS/Windows).

Quick Start

from abhedya import Abhedya, EncryptionMode

# Initialize
crypto = Abhedya()

# 1. Generate Keys (Kyber-style LWE)
pk, sk = crypto.keygen()
print(f"Public Key Size: {len(pk)} bytes")

# 2. Encrypt (Standard Mode - High Speed)
message = b"Secret Message"
ciphertext = crypto.encrypt(pk, message, mode=EncryptionMode.STANDARD)
print(f"Ciphertext: {len(ciphertext)} bytes")

# 3. Decrypt
decrypted = crypto.decrypt(sk, ciphertext)
print(f"Decrypted: {decrypted.decode('utf-8')}")

Advanced Usage: Metered Mode (Steganography)

To generate ciphertext that mimics the statistical properties of Sanskrit verse (Poetry), use EncryptionMode.METERED.

# Encrypt with Metering (Slower, but steganographic)
ciphertext_verse = crypto.encrypt(pk, message, mode=EncryptionMode.METERED)

# The output binary is shaped to map to Sanskrit syllables
# adhering to Laghu/Guru (Light/Heavy) weight patterns.

API Reference

Abhedya(lib_path: str = None)

Initializes the library. Automatically finds the shared object if installed via pip.

keygen() -> (bytes, bytes)

Generates a new Keypair.

  • Returns: (public_key, secret_key)

encrypt(pk: bytes, msg: bytes, mode: int) -> bytes

Encrypts a message.

  • mode:
    • 0 (Standard): Raw LWE output.
    • 1 (Metered): Prosody-compliant output.

decrypt(sk: bytes, ct: bytes) -> bytes

Decrypts the ciphertext.

License

MIT License. See Repository for details.

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

abhedya-1.0.10.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

abhedya-1.0.10-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file abhedya-1.0.10.tar.gz.

File metadata

  • Download URL: abhedya-1.0.10.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for abhedya-1.0.10.tar.gz
Algorithm Hash digest
SHA256 10b463ca693c4251e2058642934124f8638945575c74328ec2216cbbadf7e3db
MD5 ea50bff80bb8849bf4a35de252b12ca6
BLAKE2b-256 07461c633c4e31212d94e01beef29468778c423379f49a86cf927d03bc9296d0

See more details on using hashes here.

File details

Details for the file abhedya-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: abhedya-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for abhedya-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4ba659752d1dbc410649c1474680311c809aeeeff4c42ec04393f65d0bc971b6
MD5 6271905de3eebe73f157d395665d5ed7
BLAKE2b-256 a77ea509114099830befda11121ef203a2b8db7a5a97fba6cf75d8659508c401

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