argon2-pass
Advanced tools
Comparing version 0.2.0 to 0.2.1
# Changelog | ||
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
## [0.2.1] - 2018-09-09 | ||
### Removed | ||
- Removed development console.log calls from the module, these were left in after testing the changes to `static readonly` values. | ||
## [0.2.0] - 2018-09-08 | ||
@@ -51,5 +56,7 @@ ### Added | ||
<!-- Links --> | ||
[Unreleased]: https://github.com/DrBarnabus/secure-pass/compare/v0.1.3...HEAD | ||
[Unreleased]: https://github.com/DrBarnabus/secure-pass/compare/v0.2.1...HEAD | ||
[0.2.1]: https://github.com/DrBarnabus/secure-pass/compare/v0.2.0...v0.2.1 | ||
[0.2.0]: https://github.com/DrBarnabus/secure-pass/compare/v0.1.3...v0.2.0 | ||
[0.1.3]: https://github.com/DrBarnabus/secure-pass/compare/v0.1.2...v0.1.3 | ||
[0.1.2]: https://github.com/DrBarnabus/secure-pass/compare/v0.1.1...v0.1.2 | ||
[0.1.1]: https://github.com/DrBarnabus/secure-pass/compare/v0.1.0...v0.1.1 |
@@ -28,2 +28,8 @@ "use strict"; | ||
}); | ||
test('MacBytes Constant should be defined.', () => { | ||
expect(__1.SecurePass.MacBytes).toBeDefined(); | ||
}); | ||
test('KeyBytes Constant should be defined.', () => { | ||
expect(__1.SecurePass.KeyBytes).toBeDefined(); | ||
}); | ||
test('MemLimit* Constants should be defined.', () => { | ||
@@ -30,0 +36,0 @@ expect(__1.SecurePass.MemLimitDefault).toBeDefined(); |
@@ -72,3 +72,11 @@ /** | ||
static readonly SaltBytes: number; | ||
/** | ||
* Length of the Mac buffer returned by generateOneTimeAuth. | ||
* @readonly | ||
*/ | ||
static readonly MacBytes: number; | ||
/** | ||
* Length of the secret Key buffer returned by generateOneTimeAuth and generateOneTimeAuthCode. | ||
* @readonly | ||
*/ | ||
static readonly KeyBytes: number; | ||
@@ -75,0 +83,0 @@ /** |
@@ -81,4 +81,4 @@ "use strict"; | ||
static generateOneTimeAuth(message) { | ||
const mac = Buffer.alloc(sodium_native_1.default.crypto_onetimeauth_BYTES); | ||
const key = Buffer.alloc(sodium_native_1.default.crypto_onetimeauth_KEYBYTES); | ||
const mac = Buffer.alloc(SecurePass.MacBytes); | ||
const key = Buffer.alloc(SecurePass.KeyBytes); | ||
sodium_native_1.default.randombytes_buf(key); | ||
@@ -167,3 +167,3 @@ sodium_native_1.default.crypto_onetimeauth(mac, message, key); | ||
hashPasswordSync(password) { | ||
if (!(password.length > SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
if (!(password.length >= SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
throw new error_1.SecurePassError(`Length of Password Buffer must be between ${SecurePass.PasswordBytesMin} and ${SecurePass.PasswordBytesMax}`); | ||
@@ -190,3 +190,3 @@ } | ||
verifyHashSync(password, hash) { | ||
if (!(password.length > SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
if (!(password.length >= SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
throw new error_1.SecurePassError(`Length of Password Buffer must be between ${SecurePass.PasswordBytesMin} and ${SecurePass.PasswordBytesMax}`); | ||
@@ -211,3 +211,3 @@ } | ||
return new Promise((resolve, reject) => { | ||
if (!(password.length > SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
if (!(password.length >= SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
reject(new error_1.SecurePassError(`Length of Password Buffer must be between ${SecurePass.PasswordBytesMin} and ${SecurePass.PasswordBytesMax}`)); | ||
@@ -231,3 +231,3 @@ } | ||
return new Promise((resolve, reject) => { | ||
if (!(password.length > SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
if (!(password.length >= SecurePass.PasswordBytesMin && password.length < SecurePass.PasswordBytesMax)) { | ||
reject(new error_1.SecurePassError(`Length of Password Buffer must be between ${SecurePass.PasswordBytesMin} and ${SecurePass.PasswordBytesMax}`)); | ||
@@ -265,3 +265,3 @@ } | ||
*/ | ||
SecurePass.PasswordBytesMin = 0; | ||
SecurePass.PasswordBytesMin = 1; | ||
/** | ||
@@ -282,5 +282,13 @@ * Maxium Length for the Password input buffer. | ||
SecurePass.SaltBytes = 16; | ||
SecurePass.MacBytes = sodium_native_1.default.crypto_onetimeauth_BYTES; | ||
SecurePass.KeyBytes = sodium_native_1.default.crypto_onetimeauth_KEYBYTES; | ||
/** | ||
* Length of the Mac buffer returned by generateOneTimeAuth. | ||
* @readonly | ||
*/ | ||
SecurePass.MacBytes = 16; | ||
/** | ||
* Length of the secret Key buffer returned by generateOneTimeAuth and generateOneTimeAuthCode. | ||
* @readonly | ||
*/ | ||
SecurePass.KeyBytes = 32; | ||
/** | ||
* Default Memory Limit. 64MB. | ||
@@ -363,4 +371,2 @@ * @readonly | ||
exports.default = SecurePass; | ||
console.log(SecurePass.MacBytes); | ||
console.log(SecurePass.KeyBytes); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "argon2-pass", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "State of the art password hashing and one time password reset token generation module written in TypeScript for nodejs.", | ||
@@ -12,3 +12,3 @@ "main": "./dist/index.js", | ||
"build": "tsc", | ||
"prepublishonly": "yarn build" | ||
"prepare": "yarn build" | ||
}, | ||
@@ -66,4 +66,14 @@ "dependencies": { | ||
"token", | ||
"typescript" | ||
"typescript", | ||
"argon2 password", | ||
"secure password", | ||
"argon2id password", | ||
"password hasing", | ||
"password hasher", | ||
"password security", | ||
"one time authentication", | ||
"one time authentication code", | ||
"one time key", | ||
"cryptography" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
629484
3520
3