Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
rust_citadel — Post-quantum hybrid encryption library combining X25519 + ML-KEM-768 with AES-256-GCM | Kitploit
Tools/GitHubGitHub/mrcord77/rust_citadel
Authentication & AuthorizationEncryption/Decryption ToolsCryptographyCloud SecurityAPI Security
GitHubmrcord77/rust_citadel

rust_citadel

Post-quantum hybrid encryption library combining X25519 + ML-KEM-768 with AES-256-GCM

View Repository
2235 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Citadel

Post-quantum hybrid encryption and key management server.

Citadel combines X25519 + ML-KEM-768 for key encapsulation and AES-256-GCM for data encryption, following NIST's hybrid approach for the post-quantum transition. Applications encrypt and decrypt data through a REST API. Citadel manages the keys — generation, rotation, revocation, access control, and audit logging.

Status: Working implementation. Unaudited. No production deployments. See Security below.


What It Does

Your Application              Citadel                         Database
       |                         |                               |
       |-- POST /encrypt ------->|                               |
       |                         |-- hybrid KEM (X25519+ML-KEM)  |
       |                         |-- derive AES-256 key (HKDF)   |
       |                         |-- encrypt with AES-256-GCM    |
       |<-- encrypted blob ------|                               |
       |                                                         |
       |-- store blob ------------------------------------------>|

Your application never touches raw key material. The encrypted blob is self-contained — it includes the wrapped key, algorithm identifiers, and ciphertext. Store it in any database. Decrypt by sending it back to Citadel with the same AAD and context.

Architecture

citadel-envelope    Hybrid encryption core (X25519 + ML-KEM-768 + AES-256-GCM)
citadel-keystore    Key lifecycle management, 4-level hierarchy, threat-adaptive policies
citadel-api         HTTP server, scoped API key auth, rate limiting, real-time dashboard

Quick Start

Docker (recommended)

# Clone
git clone https://github.com/mrcord77/rust_citadel.git
cd rust_citadel

# Set your admin API key
echo -n "your-secret-key" | sha256sum | cut -d' ' -f1
# Copy the hash

# Start
CITADEL_API_KEY_HASH=<paste-hash> docker compose up -d

# Verify
curl http://localhost:3000/health
# {"status":"ok","version":"0.2.0"}

Dashboard: http://localhost:3000

From Source

Requires Rust 1.75+.

cargo build --release -p citadel-api
CITADEL_API_KEY="your-secret-key" CITADEL_SEED_DEMO=true ./target/release/citadel-api

Usage

Python

import requests

api = "http://localhost:3000"
headers = {"Authorization": "Bearer your-secret-key"}

# Encrypt
r = requests.post(f"{api}/api/keys/{dek_id}/encrypt", headers=headers, json={
    "plaintext": "sensitive data",
    "aad": "record-001",        # binds ciphertext to this record
    "context": "patient-records" # domain separation
})
blob = r.json()

# Decrypt
r = requests.post(f"{api}/api/decrypt", headers=headers, json={
    "blob": blob,
    "aad": "record-001",
    "context": "patient-records"
})
plaintext = r.json()["plaintext"]

See citadel_example.py for a complete working example with AAD binding, key rotation, and threat-aware application behavior.

curl

# Status
curl http://localhost:3000/api/status -H "Authorization: Bearer $KEY"

# List keys
curl http://localhost:3000/api/keys -H "Authorization: Bearer $KEY"

# Encrypt
curl -X POST http://localhost:3000/api/keys/$DEK_ID/encrypt \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"plaintext":"hello","aad":"test","context":"demo"}'

API Endpoints

EndpointMethodScopeDescription
/healthGET—Health check
/api/statusGETreadThreat level, key counts
/api/metricsGETreadSecurity metrics
/api/keysGETreadList all keys
/api/keysPOSTmanageGenerate new key
/api/keys/:idGETreadGet key details
/api/keys/:id/activatePOSTmanageActivate a pending key
/api/keys/:id/rotatePOSTmanageRotate key (new version)
/api/keys/:id/revokePOSTmanagePermanently revoke key
/api/keys/:id/destroyPOSTmanageDestroy key material
/api/keys/:id/encryptPOSTencryptEncrypt data
/api/decryptPOSTencryptDecrypt data
/api/threatGETreadThreat intelligence details
/api/policiesGETreadActive key policies
/api/auth/whoamiGETreadCurrent API key info
/api/auth/keysGETadminList API keys
/api/auth/keysPOSTadminCreate API key
/api/auth/keys/:idDELETEadminRevoke API key

Key Hierarchy

Root Key
  └── Domain Key (per environment / business unit)
        └── KEK — Key Encrypting Key (wraps DEKs)
              └── DEK — Data Encrypting Key (encrypts application data)

Follows NIST SP 800-57. Each level contains the blast radius of a compromise — a leaked DEK doesn't expose other DEKs because the KEK is separate.

API Key Scopes

ScopePermissions
readView keys, status, metrics, threat level
encryptEncrypt and decrypt data
manageCreate, rotate, revoke, destroy keys
adminAll of the above + manage API keys

admin implies all other scopes. Principle of least privilege: give monitoring dashboards read, application services read + encrypt, admin tools admin.

Adaptive Threat System

Citadel monitors security events and automatically adjusts key policies:

LevelTriggerResponse
LOWNormal operationsStandard crypto-periods
GUARDEDMinor anomaliesSlightly tighter rotation
ELEVATEDSuspicious patternsCompressed rotation schedules
HIGHActive threat indicatorsForced rotation, reduced usage limits
CRITICALUnder attackMaximum restrictions

Events that raise threat level: failed authentication, decryption failures, rapid access patterns, manual escalation. Score decays over time.

Cryptography

ComponentAlgorithmStandard
Key encapsulation (classical)X25519 ECDHRFC 7748
Key encapsulation (post-quantum)ML-KEM-768FIPS 203
Data encryptionAES-256-GCMNIST SP 800-38D
Key derivationHKDF-SHA256NIST SP 800-56C

Hybrid construction: both shared secrets are concatenated and fed through HKDF. Security holds if either X25519 or ML-KEM-768 remains secure.

Wire Format

version[1] || suite_kem[1] || suite_aead[1] || flags[1] || kem_ct_len[2] ||
x25519_ephemeral_pk[32] || mlkem768_ct[1088] || nonce[12] || aead_ct[variable]

Self-describing, versioned, no negotiation (prevents downgrade attacks). See SPEC.md for full specification.

Security Properties

  • Constant-time comparison — API key verification via subtle crate prevents timing attacks
  • Zeroization — All shared secrets and AES keys wrapped in Zeroizing<T>, zeroed on drop
  • Uniform errors — Decryption failures return identical error messages (no decryption oracle)
  • Integrity-chained audit log — SHA-256 hash chain detects log tampering
  • Rate limiting — Per-IP token bucket with threat escalation on violations

Security

Citadel is unaudited software.

The implementation uses NIST-standardized primitives via established Rust crates (ml-kem, x25519-dalek, aes-gcm, hkdf). It does not implement any cryptographic algorithms. The value is in correct composition, not novel math.

What has been done:

  • Comprehensive test suite including known-answer tests
  • Fuzz testing of wire format parser and full decryption path
  • Timing analysis of encryption/decryption operations
  • Uniform error handling to prevent decryption oracles

What has NOT been done:

  • Independent security audit
  • Formal verification
  • FIPS validation
  • Production deployment
Download Tool