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.
- β 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
- 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
-
Quantum Entropy Generation
- Generates
N-bit random number from a Hadamard-applied quantum circuit.
- Generates
-
Anomaly Detection
- Trains
IsolationForestandLocalOutlierFactormodels to verify randomness integrity.
- Trains
-
Secure Hashing
- Combines login, password, and quantum entropy.
- Applies PBKDF2 with SHA-256 for secure hash derivation.
- Adds HMAC to detect tampering.
-
Verification
- Validates the entropy integrity using pre-trained models.
- Recalculates the hash and HMAC to verify credentials.
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)