Skip to content

πŸ” A simple and secure implementation of Kyber512 post-quantum encryption and decryption in Python. Designed for developers exploring quantum-safe cryptography.

License

Notifications You must be signed in to change notification settings

odaysec/kybercryptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” KyberCryptor MIT License

Quantum-resistant encryption tool implementing Kyber512 (NIST-standardized PQC algorithm) with hybrid encryption capabilities.

Warning

Developed for educational/research purposes only. Not recommended for production use or sensitive data protection.

🌟 Features

  • Post-Quantum Secure: Implements Kyber512 (NIST PQC Finalist)
  • Hybrid Encryption: Combines Kyber KEM with XOR symmetric encryption
  • Simple CLI Interface: Easy encrypt/decrypt workflows
  • Cross-Platform: Supports Linux, macOS, and Windows*
  • Lightweight: Minimal dependencies with Python 3.8+ compatibility

*Windows requires manual liboqs compilation

πŸ“‹ Prerequisites

  • Python 3.8+
  • Open Quantum Safe Library (liboqs)
  • Python oqs bindings

πŸš€ Quick Start

1. Clone Repository

git clone https://github.com/odaysec/kybercryptor.git
cd kybercryptor

2. Setup Virtual Environment

python3 -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

3. Install Dependencies

# Install OQS Python bindings
pip install oqs

πŸ›  Usage Guide Encrypt Message

  1. Edit encrypt.py to modify default message ("Kyber")
  2. Run encryption:
python encrypt.py

Generates:

  • kyber_encrypted.dat (encrypted payload)
  • Keypair and shared secret

πŸ”“ Decrypt Message

python decrypt.py

Outputs decrypted message to console

πŸ“‚ File Structure

kybercryptor/
β”œβ”€β”€ encrypt.py          # Encryption workflow
β”œβ”€β”€ decrypt.py          # Decryption workflow
β”œβ”€β”€ utils.py            # XOR encryption helpers
β”œβ”€β”€ requirements.txt   # Dependency list
β”œβ”€β”€ LICENSE            # MIT License
└── examples/          # Usage examples (future)

πŸ’» Example Session

# Encryption
$ python encrypt.py
Successfully encrypted message to kyber_encrypted.dat

# Decryption 
$ python decrypt.py
Decrypted message: Kyber

πŸ”„ Process Flow

Encryption Workflow

sequenceDiagram
    participant User
    participant Encrypt.py
    participant OQS
    participant File
    
    User->>Encrypt.py: Execute script
    Encrypt.py->>OQS: Generate Kyber512 keypair
    OQS-->>Encrypt.py: (pk, sk)
    Encrypt.py->>OQS: Encapsulate shared secret
    OQS-->>Encrypt.py: ciphertext, ss
    Encrypt.py->>Encrypt.py: XOR encrypt message (msg βŠ• ss)
    Encrypt.py->>File: Save pk + ciphertext + encrypted_msg
Loading

Decryption Workflow

sequenceDiagram
    participant User
    participant Decrypt.py
    participant OQS
    participant File
    
    User->>Decrypt.py: Execute script
    Decrypt.py->>File: Load encrypted data
    Decrypt.py->>OQS: Decapsulate shared secret (sk, ciphertext)
    OQS-->>Decrypt.py: ss
    Decrypt.py->>Decrypt.py: XOR decrypt message (encrypted_msg βŠ• ss)
    Decrypt.py-->>User: Display plaintext
Loading

πŸ“š Documentation Hybrid Encryption Workflow

  1. Kyber512 generates public/private keypair
  2. Shared secret established via KEM
  3. XOR cipher encrypts payload using shared secret
  4. Encrypted data stored with public key

πŸ“œ License

MIT Licensed - See LICENSE for details.

About

πŸ” A simple and secure implementation of Kyber512 post-quantum encryption and decryption in Python. Designed for developers exploring quantum-safe cryptography.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages