{
  "name": "password-hash",
  "description": "Password hashing and verification for node.js",
  "version": "1.2.1",
  "author": {
    "name": "David Wood",
    "email": "bitprobe@gmail.com"
  },
  "repository": {
    "type": "git",
    "url": "http://github.com/davidwood/node-password-hash.git"
  },
  "keywords": [
    "password",
    "hash",
    "utilities",
    "cli"
  ],
  "devDependencies": {
    "expresso": ">= 0.7",
    "colors": ">=0.5.0"
  },
  "main": "./lib/password-hash.js",
  "engines": {
    "node": ">= 0.4.0"
  },
  "bin": {
    "nodepw": "./bin/nodepw"
  },
  "readme": "# Password hashing and verification for node.js\n\npassword-hash is a node.js library to simplify use of hashed passwords.\n\nStoring passwords in plain-text is bad.  This library makes the storing of passwords (and subsequent validation of) hashed passwords a bit easier.  \n\npassword-hash provides functions for generating a hashed passwords and verifying a plain-text password against a hashed password.  For a bit of added strength, a random salt is generated when the password is hashed.  The hashed password contains both the cryptographic algorithm that was used as well the salt, so all that is needed to verify a plain-text password is the hashed password itself.\n\n## Installation\n\n    npm install password-hash\n\n## Usage\n\n### generate(password, [options])\n\nGenerates a hash of the required `password` argument.  Hashing behavior can be modified with the optional `options` object:\n\n* `algorithm` - A valid cryptographic algorithm for use with the `crypto.createHmac` function, defaults to 'sha1'.\n* `saltLength` - The length of the salt that will be generated when the password is hashed, defaults to 8.\n* `iterations` - The number of times the hashing algorithm should be applied, defaults to 1.\n\nErrors are thrown if:\n\n* `password` is not a string\n* `options.algorithm` is specified but not a valid cryptographic algorithm\n* `options.saltLength` is specified but not a positive integer\n\nThe hashed password will be in the format `algorithm$salt$hash`.\n\nExample:\n<pre>\n    var passwordHash = require('password-hash');\n\n    var hashedPassword = passwordHash.generate('password123');\n\n    console.log(hashedPassword); // sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97\n</pre>\n\n### verify(password, hashedPassword)\n\nCompares a plain-text password (`password`) to a hashed password (`hashedPassword`) and returns a boolean.  Both arguments are required.\n\nExample:\n<pre>\n    var passwordHash = require('./lib/password-hash');\n\n    var hashedPassword = 'sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97';\n    \n    console.log(passwordHash.verify('password123', hashedPassword)); // true\n    console.log(passwordHash.verify('Password0', hashedPassword)); // false\n</pre>\n\n### isHashed(password)\n\nCheck if a password (`password`) is hashed.  Returns a boolean.\n\nExample:\n<pre>\n    var passwordHash = require('./lib/password-hash');\n\n    var hashedPassword = 'sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97';\n    \n    console.log(passwordHash.isHashed('password123')); // false\n    console.log(passwordHash.isHashed(hashedPassword)); // true\n</pre>\n\n## Salt Generation\n\nnode 0.5.8 introduced `crypto.randomBytes`, which generates cryptographically strong pseudo-random data. If the version of node supports `crypto.randomBytes` it is used to generate the salt, otherwise `Math.random`, which is not cryptographically strong, is used. This is handled transparently within the salt generation function and does not impact the module's API. \n\n## Inspired by\n\npassword-hash is inspired by the password hashing found in [Werkzeug](http://werkzeug.pocoo.org/).\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/davidwood/node-password-hash/issues"
  },
  "_id": "password-hash@1.2.1",
  "dist": {
    "shasum": "c5b070da8b279c568dec4f2570b5c43d547786b0"
  },
  "_from": "password-hash@",
  "_resolved": "https://registry.npmjs.org/password-hash/-/password-hash-1.2.1.tgz"
}
