{ "name": "bcrypt", "description": "A bcrypt library for NodeJS.", "keywords": [ "bcrypt", "password", "auth", "authentication", "encryption", "crypt", "crypto" ], "main": "./bcrypt", "version": "0.7.8", "author": { "name": "Nick Campbell", "url": "https://github.com/ncb000gt" }, "engines": { "node": ">= 0.6.0" }, "repository": { "type": "git", "url": "https://github.com/ncb000gt/node.bcrypt.js.git" }, "licenses": [ { "type": "MIT" } ], "bugs": { "url": "https://github.com/ncb000gt/node.bcrypt.js/issues" }, "scripts": { "test": "node-gyp configure build && nodeunit test", "install": "node-gyp rebuild" }, "dependencies": { "bindings": "1.0.0" }, "devDependencies": { "nodeunit": ">=0.6.4" }, "contributors": [ { "name": "Antonio Salazar Cardozo", "email": "savedfastcool@gmail.com", "url": "https://github.com/Shadowfiend" }, { "name": "Van Nguyen", "email": "the.gol.effect@gmail.com", "url": "https://github.com/thegoleffect" }, { "name": "David Trejo", "email": "david@dtrejo.com", "url": "https://github.com/dtrejo" }, { "name": "Ben Glow", "email": "glen.low@pixelglow.com", "url": "https://github.com/pixelglow" }, { "name": "NewITFarmer.com", "url": "https://github.com/newitfarmer" }, { "name": "Alfred Westerveld", "email": "alfredwesterveld@gmail.com", "url": "https://github.com/alfredwesterveld" }, { "name": "Vincent Côté-Roy", "email": "vincentcr@gmail.com", "url": "https://github.com/vincentcr" }, { "name": "Lloyd Hilaiel", "email": "lloyd@hilaiel.com", "url": "https://github.com/lloyd" }, { "name": "Roman Shtylman", "email": "shtylman@gmail.com", "url": "https://github.com/shtylman" }, { "name": "Vadim Graboys", "email": "dimva13@gmail.com", "url": "https://github.com/vadimg" }, { "name": "Ben Noorduis", "url": "https://github.com/bnoordhuis" }, { "name": "Nate Rajlich", "email": "nathan@tootallnate.net", "url": "https://github.com/tootallnate" }, { "name": "Sean McArthur", "email": "sean.monstar@gmail.com", "url": "https://github.com/seanmonstar" }, { "name": "Fanie Oosthuysen", "email": "fanie.oosthuysen@gmail.com", "url": "https://github.com/weareu" } ], "gypfile": true, "readme": "# node.bcrypt.js\n\n[![Build Status](https://secure.travis-ci.org/ncb000gt/node.bcrypt.js.png)](http://travis-ci.org/#!/ncb000gt/node.bcrypt.js) \n\nLib to help you hash passwords.\n[bcrypt on wikipedia][bcryptwiki]\n\nCatalyst for this module: [How To Safely Store A Password][codahale]\n\n## If You Are Submitting Bugs/Issues\n\nFirst, make sure that the version of node you are using is a _stable_ version. You'll know this because it'll have an even major release number. We do not currently support unstable versions and while the module may happen to work on some unstable versions you'll find that we quickly close issues if you're not using a stable version.\n\nIf you are on a stable version of node, we can't magically know what you are doing to expose an issue, it is best if you provide a snippet of code or log files if you're having an install issue. This snippet need not include your secret sauce, but it must replicate the issue you are describing. The issues that get closed without resolution tend to be the ones that don't help us help you. Thanks.\n\n\n## Version Compatibility\n\n| Node Version | Bcrypt Version |\n| ---- | ---- |\n| <= 0.4.x | <= 0.4.x |\n| >= 0.6.x | >= 0.5.x |\n\nWindows users should make sure to have at least node 0.8.5 installed and version >= 0.7.1 of this module. \n`node-gyp` only works with stable/released versions of node. Since the `bcrypt` module uses `node-gyp` to build and install you'll need a stable version of node to use bcrypt. If you do not you'll likely see an error that starts with:\n\n gyp ERR! stack Error: \"pre\" versions of node cannot be installed, use the --nodedir flag instead\n\n\n\n## Security Issues/Concerns\n\nAs should be the case with any security tool, this library should be scrutinized by anyone using it. If you find or suspect an issue with the code- please bring it to my attention and I'll spend some time trying to make sure that this tool is as secure as possible.\n\nTo make it easier for people using this tool to analyze what has been surveyed, here is a list of BCrypt related security issues/concerns as they've come up.\n\n* An [issue with passwords][jtr] was found with a version of the Blowfish algorithm developed for John the Ripper. This is not present in the OpenBSD version and is thus not a problem for this module. HT [zooko][zooko].\n\n## Dependencies\n\n* NodeJS\n* `node-gyp`\n * Please check the dependencies for this tool at: https://github.com/TooTallNate/node-gyp/\n * Windows users will need the options for c# and c++ installed with their visual studio instance.\n * Python 2.x\n\n## Install via NPM\n```\nnpm install bcrypt\n```\n\n***Note:*** OS X users using Xcode 4.3.1 or above may need to run the following command in their terminal prior to installing if errors occur regarding xcodebuild: ```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```\n\n## Usage\n\n### async (recommended)\n\nTo hash a password:\n\n```javascript\nvar bcrypt = require('bcrypt');\nbcrypt.genSalt(10, function(err, salt) {\n bcrypt.hash(\"B4c0/\\/\", salt, function(err, hash) {\n // Store hash in your password DB.\n });\n});\n```\n\nTo check a password:\n\n```javascript\n// Load hash from your password DB.\nbcrypt.compare(\"B4c0/\\/\", hash, function(err, res) {\n // res == true\n});\nbcrypt.compare(\"not_bacon\", hash, function(err, res) {\n // res = false\n});\n```\n\nAuto-gen a salt and hash:\n\n```javascript\nbcrypt.hash('bacon', 8, function(err, hash) {\n});\n```\n\n\n### sync\n\nTo hash a password:\n\n```javascript\nvar bcrypt = require('bcrypt');\nvar salt = bcrypt.genSaltSync(10);\nvar hash = bcrypt.hashSync(\"B4c0/\\/\", salt);\n// Store hash in your password DB.\n```\n\nTo check a password:\n\n```javascript\n// Load hash from your password DB.\nbcrypt.compareSync(\"B4c0/\\/\", hash); // true\nbcrypt.compareSync(\"not_bacon\", hash); // false\n```\n\nAuto-gen a salt and hash:\n\n```javascript\nvar hash = bcrypt.hashSync('bacon', 8);\n```\n\n## API\n\n`BCrypt.`\n\n * `genSaltSync(rounds)`\n * `rounds` - [OPTIONAL] - the number of rounds to process the data for. (default - 10)\n * `genSalt(rounds, cb)`\n * `rounds` - [OPTIONAL] - the number of rounds to process the data for. (default - 10)\n * `cb` - [REQUIRED] - a callback to be fired once the salt has been generated. uses eio making it asynchronous.\n * `err` - First parameter to the callback detailing any errors.\n * `salt` - Second parameter to the callback providing the generated salt.\n * `hashSync(data, salt)`\n * `data` - [REQUIRED] - the data to be encrypted.\n * `salt` - [REQUIRED] - the salt to be used in encryption.\n * `hash(data, salt, cb)`\n * `data` - [REQUIRED] - the data to be encrypted.\n * `salt` - [REQUIRED] - the salt to be used to hash the password. if specified as a number then a salt will be generated and used (see examples).\n * `cb` - [REQUIRED] - a callback to be fired once the data has been encrypted. uses eio making it asynchronous.\n * `err` - First parameter to the callback detailing any errors.\n * `encrypted` - Second parameter to the callback providing the encrypted form.\n * `compareSync(data, encrypted)`\n * `data` - [REQUIRED] - data to compare.\n * `encrypted` - [REQUIRED] - data to be compared to.\n * `compare(data, encrypted, cb)`\n * `data` - [REQUIRED] - data to compare.\n * `encrypted` - [REQUIRED] - data to be compared to.\n * `cb` - [REQUIRED] - a callback to be fired once the data has been compared. uses eio making it asynchronous.\n * `err` - First parameter to the callback detailing any errors.\n * `same` - Second parameter to the callback providing whether the data and encrypted forms match [true | false].\n * `getRounds(encrypted)` - return the number of rounds used to encrypt a given hash\n * `encrypted` - [REQUIRED] - hash from which the number of rounds used should be extracted.\n\n\n## Hash Info\n\nThe characters that comprise the resultant hash are `./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$`.\n\n## Testing\n\nIf you create a pull request, tests better pass :)\n\n```\nnpm install\nnpm test\n```\n\n## Credits\n\nThe code for this comes from a few sources:\n\n* blowfish.cc - OpenBSD\n* bcrypt.cc - OpenBSD\n* bcrypt::gen_salt - [gen_salt inclusion to bcrypt][bcryptgs]\n* bcrypt_node.cc - me\n\n## Contributors\n\n* [Antonio Salazar Cardozo][shadowfiend] - Early MacOS X support (when we used libbsd)\n* [Ben Glow][pixelglow] - Fixes for thread safety with async calls\n* [Van Nguyen][thegoleffect] - Found a timing attack in the comparator\n* [NewITFarmer][newitfarmer] - Initial Cygwin support\n* [David Trejo][dtrejo] - packaging fixes\n* [Alfred Westerveld][alfredwesterveld] - packaging fixes\n* [Vincent Côté-Roy][vincentr] - Testing around concurrency issues\n* [Lloyd Hilaiel][lloyd] - Documentation fixes\n* [Roman Shtylman][shtylman] - Code refactoring, general rot reduction, compile options, better memory management with delete and new, and an upgrade to libuv over eio/ev.\n* [Vadim Graboys][vadimg] - Code changes to support 0.5.5+\n* [Ben Noordhuis][bnoordhuis] - Fixed a thread safety issue in nodejs that was perfectly mappable to this module.\n* [Nate Rajlich][tootallnate] - Bindings and build process.\n* [Sean McArthur][seanmonstar] - Windows Support\n* [Fanie Oosthuysen][weareu] - Windows Support\n\n## License\nUnless stated elsewhere, file headers or otherwise, the license as stated in the LICENSE file.\n\n[bcryptwiki]: http://en.wikipedia.org/wiki/Bcrypt\n[bcryptgs]: http://mail-index.netbsd.org/tech-crypto/2002/05/24/msg000204.html\n[codahale]: http://codahale.com/how-to-safely-store-a-password/\n[gh13]: https://github.com/ncb000gt/node.bcrypt.js/issues/13\n[jtr]: http://www.openwall.com/lists/oss-security/2011/06/20/2\n\n[shadowfiend]:https://github.com/Shadowfiend\n[thegoleffect]:https://github.com/thegoleffect\n[pixelglow]:https://github.com/pixelglow\n[dtrejo]:https://github.com/dtrejo\n[alfredwesterveld]:https://github.com/alfredwesterveld\n[newitfarmer]:https://github.com/newitfarmer\n[zooko]:https://twitter.com/zooko\n[vincentr]:https://twitter.com/vincentcr\n[lloyd]:https://github.com/lloyd\n[shtylman]:https://github.com/shtylman\n[vadimg]:https://github.com/vadimg\n[bnoordhuis]:https://github.com/bnoordhuis\n[tootallnate]:https://github.com/tootallnate\n[seanmonstar]:https://github.com/seanmonstar\n[weareu]:https://github.com/weareu\n", "readmeFilename": "README.md", "homepage": "https://github.com/ncb000gt/node.bcrypt.js", "_id": "bcrypt@0.7.8", "_shasum": "42c99aac202918e947b5bd086110184f62745e3e", "_from": "bcrypt@^0.7.8", "_resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-0.7.8.tgz" }