Loading src/passwords/PWDv1Challenge.js +7 −4 Original line number Diff line number Diff line // eslint-disable-next-line n/no-extraneous-import import sodium from 'libsodium-wrappers' import DefaultClassLoader from 'passwords-client/default-class-loader' Loading @@ -5,6 +6,7 @@ const classLoader = new DefaultClassLoader() const BasePWDv1Challenge = classLoader._classes['challenge.pwdv1'] export default class PWDv1Challenge extends BasePWDv1Challenge { constructor(data = {}) { super(data) } Loading @@ -24,7 +26,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { const genericHash = sodium.crypto_generichash( sodium.crypto_generichash_BYTES_MAX, new Uint8Array([...sodium.from_string(this._password), ...passwordSalt]), genericHashKey genericHashKey, ) const passwordHash = sodium.crypto_pwhash( Loading @@ -33,7 +35,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { passwordHashSalt, sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE, sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE, sodium.crypto_pwhash_ALG_DEFAULT sodium.crypto_pwhash_ALG_DEFAULT, ) return sodium.to_hex(passwordHash) Loading @@ -47,7 +49,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { const genericHash = sodium.crypto_generichash( sodium.crypto_generichash_BYTES_MAX, new Uint8Array([...sodium.from_string(this._password), ...passwordSalt]), genericHashKey genericHashKey, ) const passwordHashSalt = sodium.randombytes_buf(sodium.crypto_pwhash_SALTBYTES) Loading @@ -57,7 +59,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { passwordHashSalt, sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE, sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE, sodium.crypto_pwhash_ALG_DEFAULT sodium.crypto_pwhash_ALG_DEFAULT, ) return { Loading @@ -69,4 +71,5 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { secret: sodium.to_hex(passwordHash), } } } Loading
src/passwords/PWDv1Challenge.js +7 −4 Original line number Diff line number Diff line // eslint-disable-next-line n/no-extraneous-import import sodium from 'libsodium-wrappers' import DefaultClassLoader from 'passwords-client/default-class-loader' Loading @@ -5,6 +6,7 @@ const classLoader = new DefaultClassLoader() const BasePWDv1Challenge = classLoader._classes['challenge.pwdv1'] export default class PWDv1Challenge extends BasePWDv1Challenge { constructor(data = {}) { super(data) } Loading @@ -24,7 +26,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { const genericHash = sodium.crypto_generichash( sodium.crypto_generichash_BYTES_MAX, new Uint8Array([...sodium.from_string(this._password), ...passwordSalt]), genericHashKey genericHashKey, ) const passwordHash = sodium.crypto_pwhash( Loading @@ -33,7 +35,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { passwordHashSalt, sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE, sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE, sodium.crypto_pwhash_ALG_DEFAULT sodium.crypto_pwhash_ALG_DEFAULT, ) return sodium.to_hex(passwordHash) Loading @@ -47,7 +49,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { const genericHash = sodium.crypto_generichash( sodium.crypto_generichash_BYTES_MAX, new Uint8Array([...sodium.from_string(this._password), ...passwordSalt]), genericHashKey genericHashKey, ) const passwordHashSalt = sodium.randombytes_buf(sodium.crypto_pwhash_SALTBYTES) Loading @@ -57,7 +59,7 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { passwordHashSalt, sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE, sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE, sodium.crypto_pwhash_ALG_DEFAULT sodium.crypto_pwhash_ALG_DEFAULT, ) return { Loading @@ -69,4 +71,5 @@ export default class PWDv1Challenge extends BasePWDv1Challenge { secret: sodium.to_hex(passwordHash), } } }