safecrypt
v1.0.1
Published
Triple-layer password hashing: bcrypt → argon2 → noctahash for maximum security
Maintainers
Readme
SafeCrypt
Triple-layer password hashing: bcrypt → argon2 → noctahash
Secure password hashing using three industry-standard algorithms in sequence.
Overview
SafeCrypt hashes passwords through three layers:
- bcrypt - Standard password hashing
- argon2 - Memory-hard hashing
- noctahash - Modern memory-hard hashing
Features
- Triple-layer security
- Memory-hard, resistant to GPU/ASIC attacks
- Configurable security levels
- TypeScript support
Installation
npm install safecryptUsage
Basic
const safecrypt = require('safecrypt');
// Hash password
const hash = await safecrypt.hash('password123');
// Verify password
const isValid = await safecrypt.verify('password123', hash);Custom Options
const hash = await safecrypt.hash('password123', {
bcryptRounds: 12,
argon2Options: {
memoryCost: 131072,
timeCost: 4,
parallelism: 4
},
noctahashOptions: {
timeCost: 4,
memoryCostMB: 128,
parallelism: 1
}
});API
hash(password, options?)
Hashes a password using the triple-layer method.
Parameters:
password(string): Password to hashoptions(object, optional): Configuration options
Returns: Promise<string> - Cascade hash string
verify(password, hashString)
Verifies password against hash.
Parameters:
password(string): Password to verifyhashString(string): Hash from hash()
Returns: Promise<boolean> - True if match
Security
- Each algorithm uses its own salt
- Security gains are multiplicative
- Hash time: ~500ms (default) to ~10s (maximum)
- Best for high-value accounts and critical systems
- Not suitable for high-throughput authentication
License
MIT
Author
Tuna4L
