Password-Derived Signature Authentication - A secure alternative to traditional password authentication that never exposes passwords to servers.
PDSA (Password-Derived Signature Authentication) is a novel authentication approach that combines the familiarity of passwords with the security of digital signatures. Instead of sending passwords to servers, users derive cryptographic key pairs from their passwords and use digital signatures for authentication.
- 🛡️ No Password Exposure: Passwords never leave the client device in plaintext
- 🔒 Server Compromise Protection: Even if the server is breached, attackers cannot impersonate users
- 🔄 Automatic Key Rotation: Changing passwords naturally generates new key pairs
- 🚫 No Cross-Service Linkability: Each service gets unique keys due to unique salts
- ⚡ Simple Implementation: Much simpler than complex protocols like SRP or OPAQUE
- Password Derivation: PBKDF2
- Digital Signatures: ECDSA with secp256k1 curve
- Challenge-Response: Prevents replay attacks
- Unique Salts: Prevents rainbow table attacks
- Python 3.7+
- Modern web browser
- Internet connection (for loading crypto library)
-
Clone the repository
git clone https://github.com/danieltanfh95/pdsa.git cd pdsa -
Install Python dependencies
-
Run the server
-
Open your browser
http://localhost:8000 # or python client.py
Register a new user with their public key and salt.
Request:
Response:
Initiate login by requesting a challenge.
Request:
Response:
Complete authentication by providing signature.
Request:
Response:
The project includes two client implementations:
- CryptoJS + Elliptic: For PBKDF2 key derivation and ECDSA operations
- Modern Web APIs: Uses Web Crypto API and fetch for HTTP requests
- DER Encoding: Proper ASN.1 DER formatting for compatibility with server
- Cryptography Library: Uses Python's cryptography package
JavaScript (Web Client):
Python (CLI Client):
- Password Protection: Passwords never transmitted or stored in plaintext
- Salt Uniqueness: Each user gets a cryptographically random salt
- Challenge Freshness: Challenges expire after 5 minutes
- Signature Verification: Server validates signatures using stored public keys
- Replay Protection: Each authentication uses a unique challenge
For production deployment, consider these enhancements:
- HTTPS Requirement: Web Crypto API requires secure contexts
- Rate Limiting: Prevent brute force attacks on authentication endpoints
- Session Management: Implement JWT tokens or secure sessions
- Input Validation: Add comprehensive input sanitization
- Database Security: Use proper database credentials and connection pooling
- CORS Configuration: Restrict allowed origins to your domain
- Monitoring: Add logging and monitoring for security events
| Server sees password | ❌ Yes | ✅ No | ✅ No | ✅ No |
| Implementation complexity | ✅ Simple | ✅ Simple | ❌ Complex | ❌ Very Complex |
| Mutual authentication | ❌ No | ❌ No | ✅ Yes | ✅ Yes |
| Server compromise protection | ❌ No | ✅ Yes | ✅ Yes | ✅ Yes |
| Standards compliance | ✅ Widely adopted | ❌ Novel approach | ✅ RFC standard | ✅ IRTF draft |
| Browser compatibility | ✅ Universal | ✅ Modern browsers | ❌ Requires libraries | ❌ Limited support |
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer: This is a proof-of-concept implementation. While the cryptographic principles are sound, this code has not undergone formal security auditing. Use in production environments at your own risk and consider professional security review.
.png)

![The 8pen input method for phones (2010) [video]](https://www.youtube.com/img/desktop/supported_browsers/edgium.png)
