-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
107 lines (107 loc) · 13.5 KB
/
Copy pathpackage.json
File metadata and controls
107 lines (107 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
"_args": [
[
{
"raw": "bcryptjs@https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"scope": null,
"escapedName": "bcryptjs",
"name": "bcryptjs",
"rawSpec": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"spec": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"type": "remote"
},
"C:\\Users\\ibcn\\Documents\\Ghost"
]
],
"_from": "bcryptjs@2.4.3",
"_id": "bcryptjs@2.4.3",
"_inCache": true,
"_location": "/bcryptjs",
"_phantomChildren": {},
"_requested": {
"raw": "bcryptjs@https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"scope": null,
"escapedName": "bcryptjs",
"name": "bcryptjs",
"rawSpec": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"spec": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"type": "remote"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"_shasum": "9ab5627b93e60621ff7cdac5da9733027df1d0cb",
"_shrinkwrap": null,
"_spec": "bcryptjs@https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"_where": "C:\\Users\\ibcn\\Documents\\Ghost",
"author": {
"name": "Daniel Wirtz",
"email": "dcode@dcode.io"
},
"browser": "dist/bcrypt.js",
"bugs": {
"url": "https://github.com/dcodeIO/bcrypt.js/issues"
},
"contributors": [
{
"name": "Shane Girish",
"email": "shaneGirish@gmail.com",
"url": "https://github.com/shaneGirish"
},
{
"name": "Alex Murray",
"url": "https://github.com/alexmurray"
},
{
"name": "Nicolas Pelletier",
"url": "https://github.com/NicolasPelletier"
},
{
"name": "Josh Rogers",
"url": "https://github.com/geekymole"
},
{
"name": "Noah Isaacson",
"email": "noah@nisaacson.com",
"url": "https://github.com/nisaacson"
}
],
"dependencies": {},
"description": "Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.",
"devDependencies": {
"bcrypt": "latest",
"closurecompiler": "~1",
"metascript": "~0.18",
"testjs": "~1",
"utfx": "~1"
},
"homepage": "https://github.com/dcodeIO/bcrypt.js#readme",
"keywords": [
"bcrypt",
"password",
"auth",
"authentication",
"encryption",
"crypt",
"crypto"
],
"license": "MIT",
"main": "index.js",
"name": "bcryptjs",
"optionalDependencies": {},
"readme": "bcrypt.js\r\n=========\r\nOptimized bcrypt in JavaScript with zero dependencies. Compatible to the C++ [bcrypt](https://npmjs.org/package/bcrypt)\r\nbinding on node.js and also working in the browser.\r\n\r\n<a href=\"https://travis-ci.org/dcodeIO/bcrypt.js\"><img alt=\"build static\" src=\"https://travis-ci.org/dcodeIO/bcrypt.js.svg?branch=master\" /></a> <a href=\"https://npmjs.org/package/bcryptjs\"><img src=\"https://img.shields.io/npm/v/bcryptjs.svg\" alt=\"\"></a> <a href=\"https://npmjs.org/package/bcryptjs\"><img src=\"https://img.shields.io/npm/dm/bcryptjs.svg\" alt=\"\"></a> <a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dcode%40dcode.io&item_name=Open%20Source%20Software%20Donation&item_number=dcodeIO%2Fbcrypt.js\"><img alt=\"donate ❤\" src=\"https://img.shields.io/badge/donate-❤-ff2244.svg\"></a>\r\n\r\n\r\nSecurity considerations\r\n-----------------------\r\nBesides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the\r\niteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with\r\nincreasing computation power. ([see](http://en.wikipedia.org/wiki/Bcrypt))\r\n\r\nWhile bcrypt.js is compatible to the C++ bcrypt binding, it is written in pure JavaScript and thus slower ([about 30%](https://github.com/dcodeIO/bcrypt.js/wiki/Benchmark)), effectively reducing the number of iterations that can be\r\nprocessed in an equal time span.\r\n\r\nThe maximum input length is 72 bytes (note that UTF8 encoded characters use up to 4 bytes) and the length of generated\r\nhashes is 60 characters.\r\n\r\nUsage\r\n-----\r\nThe library is compatible with CommonJS and AMD loaders and is exposed globally as `dcodeIO.bcrypt` if neither is\r\navailable.\r\n\r\n### node.js\r\n\r\nOn node.js, the inbuilt [crypto module](http://nodejs.org/api/crypto.html)'s randomBytes interface is used to obtain\r\nsecure random numbers.\r\n\r\n`npm install bcryptjs`\r\n\r\n```js\r\nvar bcrypt = require('bcryptjs');\r\n...\r\n```\r\n\r\n### Browser\r\n\r\nIn the browser, bcrypt.js relies on [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI)'s getRandomValues\r\ninterface to obtain secure random numbers. If no cryptographically secure source of randomness is available, you may\r\nspecify one through [bcrypt.setRandomFallback](https://github.com/dcodeIO/bcrypt.js#setrandomfallbackrandom).\r\n\r\n```js\r\nvar bcrypt = dcodeIO.bcrypt;\r\n...\r\n```\r\n\r\nor\r\n\r\n```js\r\nrequire.config({\r\n paths: { \"bcrypt\": \"/path/to/bcrypt.js\" }\r\n});\r\nrequire([\"bcrypt\"], function(bcrypt) {\r\n ...\r\n});\r\n```\r\n\r\nUsage - Sync\r\n------------\r\nTo hash a password: \r\n\r\n```javascript\r\nvar bcrypt = require('bcryptjs');\r\nvar salt = bcrypt.genSaltSync(10);\r\nvar hash = bcrypt.hashSync(\"B4c0/\\/\", salt);\r\n// Store hash in your password DB.\r\n```\r\n\r\nTo check a password: \r\n\r\n```javascript\r\n// Load hash from your password DB.\r\nbcrypt.compareSync(\"B4c0/\\/\", hash); // true\r\nbcrypt.compareSync(\"not_bacon\", hash); // false\r\n```\r\n\r\nAuto-gen a salt and hash:\r\n\r\n```javascript\r\nvar hash = bcrypt.hashSync('bacon', 8);\r\n```\r\n\r\nUsage - Async\r\n-------------\r\nTo hash a password: \r\n\r\n```javascript\r\nvar bcrypt = require('bcryptjs');\r\nbcrypt.genSalt(10, function(err, salt) {\r\n bcrypt.hash(\"B4c0/\\/\", salt, function(err, hash) {\r\n // Store hash in your password DB.\r\n });\r\n});\r\n```\r\n\r\nTo check a password: \r\n\r\n```javascript\r\n// Load hash from your password DB.\r\nbcrypt.compare(\"B4c0/\\/\", hash, function(err, res) {\r\n // res === true\r\n});\r\nbcrypt.compare(\"not_bacon\", hash, function(err, res) {\r\n // res === false\r\n});\r\n\r\n// As of bcryptjs 2.4.0, compare returns a promise if callback is omitted:\r\nbcrypt.compare(\"B4c0/\\/\", hash).then((res) => {\r\n // res === true\r\n});\r\n```\r\n\r\nAuto-gen a salt and hash:\r\n\r\n```javascript\r\nbcrypt.hash('bacon', 8, function(err, hash) {\r\n});\r\n```\r\n\r\n**Note:** Under the hood, asynchronisation splits a crypto operation into small chunks. After the completion of a chunk, the execution of the next chunk is placed on the back of [JS event loop queue](https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop), thus efficiently sharing the computational resources with the other operations in the queue.\r\n\r\nAPI\r\n---\r\n### setRandomFallback(random)\r\n\r\nSets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto\r\nAPI is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it is\r\nseeded properly!\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| random | *function(number):!Array.<number>* | Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values. \r\n| **@see** | | http://nodejs.org/api/crypto.html \r\n| **@see** | | http://www.w3.org/TR/WebCryptoAPI/\r\n\r\n**Hint:** You might use [isaac.js](https://github.com/rubycon/isaac.js) as a CSPRNG but you still have to make sure to\r\nseed it properly.\r\n\r\n### genSaltSync(rounds=, seed_length=)\r\n\r\nSynchronously generates a salt.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| rounds | *number* | Number of rounds to use, defaults to 10 if omitted \r\n| seed_length | *number* | Not supported. \r\n| **@returns** | *string* | Resulting salt \r\n| **@throws** | *Error* | If a random fallback is required but not set \r\n\r\n### genSalt(rounds=, seed_length=, callback)\r\n\r\nAsynchronously generates a salt.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| rounds | *number | function(Error, string=)* | Number of rounds to use, defaults to 10 if omitted \r\n| seed_length | *number | function(Error, string=)* | Not supported. \r\n| callback | *function(Error, string=)* | Callback receiving the error, if any, and the resulting salt \r\n| **@returns** | *Promise* | If `callback` has been omitted\r\n| **@throws** | *Error* | If `callback` is present but not a function\r\n\r\n### hashSync(s, salt=)\r\n\r\nSynchronously generates a hash for the given string.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| s | *string* | String to hash \r\n| salt | *number | string* | Salt length to generate or salt to use, default to 10 \r\n| **@returns** | *string* | Resulting hash \r\n\r\n### hash(s, salt, callback, progressCallback=)\r\n\r\nAsynchronously generates a hash for the given string.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| s | *string* | String to hash \r\n| salt | *number | string* | Salt length to generate or salt to use \r\n| callback | *function(Error, string=)* | Callback receiving the error, if any, and the resulting hash \r\n| progressCallback | *function(number)* | Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.\r\n| **@returns** | *Promise* | If `callback` has been omitted\r\n| **@throws** | *Error* | If `callback` is present but not a function\r\n\r\n### compareSync(s, hash)\r\n\r\nSynchronously tests a string against a hash.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| s | *string* | String to compare \r\n| hash | *string* | Hash to test against \r\n| **@returns** | *boolean* | true if matching, otherwise false \r\n| **@throws** | *Error* | If an argument is illegal \r\n\r\n### compare(s, hash, callback, progressCallback=)\r\n\r\nAsynchronously compares the given data against the given hash.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| s | *string* | Data to compare \r\n| hash | *string* | Data to be compared to \r\n| callback | *function(Error, boolean)* | Callback receiving the error, if any, otherwise the result \r\n| progressCallback | *function(number)* | Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.\r\n| **@returns** | *Promise* | If `callback` has been omitted \r\n| **@throws** | *Error* | If `callback` is present but not a function\r\n\r\n### getRounds(hash)\r\n\r\nGets the number of rounds used to encrypt the specified hash.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| hash | *string* | Hash to extract the used number of rounds from \r\n| **@returns** | *number* | Number of rounds used \r\n| **@throws** | *Error* | If `hash` is not a string \r\n\r\n### getSalt(hash)\r\n\r\nGets the salt portion from a hash. Does not validate the hash.\r\n\r\n| Parameter | Type | Description\r\n|-----------------|-----------------|---------------\r\n| hash | *string* | Hash to extract the salt from \r\n| **@returns** | *string* | Extracted salt part \r\n| **@throws** | *Error* | If `hash` is not a string or otherwise invalid \r\n\r\n\r\nCommand line\r\n------------\r\n`Usage: bcrypt <input> [salt]`\r\n\r\nIf the input has spaces inside, simply surround it with quotes.\r\n\r\nDownloads\r\n---------\r\n* [Distributions](https://github.com/dcodeIO/bcrypt.js/tree/master/dist)\r\n* [ZIP-Archive](https://github.com/dcodeIO/bcrypt.js/archive/master.zip)\r\n* [Tarball](https://github.com/dcodeIO/bcrypt.js/tarball/master)\r\n\r\nCredits\r\n-------\r\nBased on work started by Shane Girish at [bcrypt-nodejs](https://github.com/shaneGirish/bcrypt-nodejs) (MIT-licensed),\r\nwhich is itself based on [javascript-bcrypt](http://code.google.com/p/javascript-bcrypt/) (New BSD-licensed).\r\n\r\nLicense\r\n-------\r\nNew-BSD / MIT ([see](https://github.com/dcodeIO/bcrypt.js/blob/master/LICENSE))\r\n",
"readmeFilename": "README.md",
"repository": {
"type": "url",
"url": "git+https://github.com/dcodeIO/bcrypt.js.git"
},
"scripts": {
"build": "node scripts/build.js",
"compile": "node node_modules/closurecompiler/bin/ccjs dist/bcrypt.js --compilation_level=SIMPLE_OPTIMIZATIONS --create_source_map=dist/bcrypt.min.map > dist/bcrypt.min.js",
"compress": "gzip -c -9 dist/bcrypt.min.js > dist/bcrypt.min.js.gz",
"make": "npm run build && npm run compile && npm run compress && npm test",
"test": "node node_modules/testjs/bin/testjs"
},
"version": "2.4.3"
}