Modular Crypt Format
This modules reads (deserialize) and writes (serialize) password fields in databases following the Modular Crypt Format (MCF).
The modular crypt format (MCF) is a standard for encoding password hash strings in order to defend a database against attacks (dictionary attacks, pre-computed rainbow table attacks, etc.).
The Modular Crypt Format is described in detail in http://pythonhosted.org/passlib/modular_crypt_format.html
Format
A password field in the Modular Crypt Format is of the following form:
$identifier$cost$salt$derived_key
Install
npm install mcf
API
Usage
Reading the format from the database:
const mcf = let mcf_field = usertry let obj = mcf let identifier = objidentifier let cost = objcost let salt = objsalt let derived_key = objderived_key catcherr if err instanceof mcfMcfError console else console
Creating the format to write in the database:
const mcf = let mcf_field = mcf
Development
To run the tests:
npm test
To compute test coverage:
npm run test:coverage
Contributions
Pull Requests and contributions in general are welcome as long as they follow the Node aesthetic.