privacy-utils-anon-auth
v0.2.1
Published
Anonymous authentication helpers including VOPRF tokens and WebAuthn ephemeral
Downloads
3
Maintainers
Readme
Privacy Utils Anonymous Authentication
Anonymous authentication helpers including VOPRF tokens and WebAuthn ephemeral authentication.
Features
- VOPRF (Verifiable Oblivious Pseudorandom Functions): Privacy-preserving token generation
- WebAuthn Ephemeral: Temporary authentication without persistent credentials
- Blind Signatures: Anonymous credential issuance
- Token Verification: Secure token validation mechanisms
- Challenge-Response: Interactive authentication protocols
- Privacy-Preserving Authentication: Zero-knowledge authentication schemes
Installation
npm install privacy-utils-anon-authUsage
import {
generateVOPRFToken,
verifyVOPRFToken,
createWebAuthnChallenge,
verifyWebAuthnResponse,
blindSign,
unblindSignature
} from 'privacy-utils-anon-auth';
// Generate VOPRF token
const token = await generateVOPRFToken(userId, serverPublicKey);
// Verify VOPRF token
const isValid = await verifyVOPRFToken(token, serverPrivateKey);
// Create WebAuthn challenge
const challenge = createWebAuthnChallenge({
userId: 'user123',
relyingPartyId: 'example.com'
});
// Verify WebAuthn response
const isAuthenticated = verifyWebAuthnResponse(challenge, clientResponse);
// Blind signature protocol
const { blindedMessage, blindingFactor } = blindMessage(originalMessage);
const blindSignature = await signBlindedMessage(blindedMessage, privateKey);
const signature = unblindSignature(blindSignature, blindingFactor);API Reference
For complete API documentation, see the TypeScript definitions or visit the main repository.
Security Considerations
- All cryptographic operations use industry-standard algorithms
- Keys should be properly managed and rotated regularly
- Authentication tokens have expiration times for security
- WebAuthn challenges are single-use to prevent replay attacks
License
MIT
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines.
