Skip to main content

Customization

You can customize some params for algorithms and options:

import { ExPass } from '@expass/node';

const expass = new ExPass('SECRET', {
power: 12,
cipherAlgorithm: 'aes-128',
})

Options

OptionTypeDescriptionDefault
powernumberThe power of the scrypt algorithm14
encodeHashLenghtnumberThe block size used to encode the password64
saltLengthnumberThe length of the salt used in the scrypt algorithm16
preHashAlgorithmstringThe algorithm used to pre-hash the password'sha256'
postHashAlgorithmstringThe algorithm used to post-hash the password'sha256'
hmacAlgorithmstringThe algorithm used to generate the HMAC'sha256'
keyDerivationPowernumberThe power of the scrypt for symmetric key derivation10
cipherAlgorithmstringThe algorithm used to encrypt the password'aes-256'

Available hash algorithms (for this implementation)

  • sha1 (not recommended)
  • sha256
  • sha512

Available cipher algorithms (for this implementation)

  • aes-128
  • aes-256