Skip to content

blackx2/cryp

Repository files navigation

πŸ” Quantum-Enhanced Password Hashing and Integrity Verification

This project demonstrates a secure login and password hashing system that incorporates quantum entropy, anomaly detection, and HMAC integrity checks. It uses simulated quantum randomness via Cirq and applies machine learning models to validate the integrity of cryptographic keys.


πŸš€ Features

  • βœ… Quantum-generated entropy using Cirq simulator
  • βœ… Password hashing with PBKDF2-HMAC-SHA256
  • βœ… Anomaly detection with Isolation Forest and Local Outlier Factor
  • βœ… HMAC integrity check for tamper resistance
  • βœ… Base64-encoded JSON structure for storage and reproducibility

πŸ“¦ Technologies Used

  • Cirq – Quantum circuit simulation
  • scikit-learn – Machine learning models for integrity checks
  • NumPy – Numerical operations
  • [hashlib / base64 / json / os] – Python built-ins for security and data encoding

πŸ”§ How It Works

  1. Quantum Entropy Generation

    • Generates N-bit random number from a Hadamard-applied quantum circuit.
  2. Anomaly Detection

    • Trains IsolationForest and LocalOutlierFactor models to verify randomness integrity.
  3. Secure Hashing

    • Combines login, password, and quantum entropy.
    • Applies PBKDF2 with SHA-256 for secure hash derivation.
    • Adds HMAC to detect tampering.
  4. Verification

    • Validates the entropy integrity using pre-trained models.
    • Recalculates the hash and HMAC to verify credentials.

πŸ§ͺ Example Usage

login = "User123"
password = "SecurePassword123!"

# Generate hash and models
stored_data, models = login_password_to_hash(login, password)

# Verify
is_valid = verify_login_password(login, password, stored_data, models)
print("Is Valid Login:", is_valid)

About

Testing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages