A demonstration of secure client-server communication in a game context, implementing various cryptographic security measures.
- Secure client-server communication using Ed25519 signatures
- Session management with key rotation
- Rate limiting and anti-replay protection
- HMAC-based message authentication
- AES encryption for key exchange
- Challenge-response authentication
- Ed25519 Signatures: Used for client authentication and challenge-response
- Session Keys: Rotated periodically for enhanced security
- HMAC Signatures: Verify message integrity
- AES Encryption: Secure key exchange
- Rate Limiting: Prevents abuse
- Timestamp Validation: Prevents replay attacks
- Nonce-based Challenges: Ensures request freshness
- Node.js (v18 or higher)
- npm
- Clone the repository:
git clone https://github.com/yourusername/crypto-game.git
cd crypto-game- Install dependencies:
npm install- Run the tests:
npm test- Run the demo:
npm startclient.ts: Client-side cryptographic operationsserver.ts: Server-side game logic and securitytypes.ts: Shared type definitionsindex.ts: Demo implementationcrypto.test.ts: Security test suite
- Private keys are stored only in memory
- Keys are rotated during score updates
- No persistent storage of sensitive data
- Rate limiting prevents abuse
- Challenge-response prevents replay attacks
MIT License - see LICENSE file for details