@sequencemedia/pbkdf2 1.0.5 β 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/compare.sh +25 -0
- package/package.json +14 -5
- package/scripts/compare.mjs +2 -2
- package/scripts/hash.mjs +2 -2
- package/scripts/salt.mjs +2 -2
- package/utils/common.mjs +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @sequencemedia/pbkdf2
|
|
2
|
+
|
|
3
|
+
ES functions are exported from package root alongside a TS definition
|
|
4
|
+
|
|
5
|
+
## Password validation
|
|
6
|
+
|
|
7
|
+
A password can be validated against a `hash` and `salt` (and the number of `iterations` that were used to compute it)
|
|
8
|
+
|
|
9
|
+
Both the `hash` and `salt` are expected from the command line to be strings in _Base64_ format
|
|
10
|
+
|
|
11
|
+
- The `hash` is decoded to a `Buffer`
|
|
12
|
+
- The `salt` is transformed from _Base64_ into _ASCII_
|
|
13
|
+
|
|
14
|
+
You can use these utilities from the shell or as part of a Node application
|
|
15
|
+
|
|
16
|
+
## Tests
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm test
|
|
20
|
+
bash ./compare.sh
|
|
21
|
+
```
|
package/compare.sh
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
#Β the-user-1
|
|
4
|
+
npm run compare -- \
|
|
5
|
+
--password "^49pPaRdVSNC" \
|
|
6
|
+
--hash "kOhpM7//M4I9+WcWLH7vbb/yN2+8qKyxQ0xAfI4JzamcRMdwwl7vAh0ch7UJ0JoBe9AqaAGuUJZF/mVA9EqaLQ==" \
|
|
7
|
+
--salt "YzFjMTY4MmMyMWE4MjFkYjRhNWE5YjJmNDY0OTUzM2Q=" \
|
|
8
|
+
--iterations 32768 \
|
|
9
|
+
--digest sha512
|
|
10
|
+
|
|
11
|
+
# the-user-2
|
|
12
|
+
npm run compare -- \
|
|
13
|
+
--password "S0uSaC&FzDOO" \
|
|
14
|
+
--hash "BrtOel2qy5HrYWn45jBKf5b3HUKdVeQfIj1ljhGxQ/SiWsmMMuOl756H4MXkMOnVJKrgFfHFy7cgFXUaSFA2ow==" \
|
|
15
|
+
--salt "MDI2OGM0MDU4NWJiOTgxNWEyYzQwN2RkYjM1YTY5YWU=" \
|
|
16
|
+
--iterations 32768 \
|
|
17
|
+
--digest sha512
|
|
18
|
+
|
|
19
|
+
# the-user-3
|
|
20
|
+
npm run compare -- \
|
|
21
|
+
--password "@^EJmdlkt5A#" \
|
|
22
|
+
--hash "bV76sVqsM0doKBFnaHsZQC9OgcVnF/+gzkG7HFXdD7jyQdN1PqCVijyXKMijmYQPWJohi5f7sVxhoLJ5kf8aQA==" \
|
|
23
|
+
--salt "ZDI3OTZmZWU3M2I3M2Y3MTgxMmYyNGM3MjU4NDE2NDM=" \
|
|
24
|
+
--iterations 32768 \
|
|
25
|
+
--digest sha512
|
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/pbkdf2",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"pbkdf2",
|
|
6
|
+
"crypto",
|
|
7
|
+
"compare",
|
|
8
|
+
"hash",
|
|
9
|
+
"salt",
|
|
10
|
+
"ecmascript",
|
|
11
|
+
"typescript"
|
|
12
|
+
],
|
|
4
13
|
"main": "./index.mjs",
|
|
5
14
|
"type": "module",
|
|
6
15
|
"author": {
|
|
@@ -14,12 +23,12 @@
|
|
|
14
23
|
"url": "git@github.com:sequencemedia/pbkdf2.git"
|
|
15
24
|
},
|
|
16
25
|
"scripts": {
|
|
17
|
-
"lint": "
|
|
26
|
+
"lint": "eslint . --ext .mjs --ext .cjs",
|
|
18
27
|
"lint:fix": "npm run lint -- --fix",
|
|
19
28
|
"test": "cross-env NODE_ENV=test mocha tests --recursive --verbose --color",
|
|
20
|
-
"compare": "
|
|
21
|
-
"hash": "
|
|
22
|
-
"salt": "
|
|
29
|
+
"compare": "node scripts/compare.mjs",
|
|
30
|
+
"hash": "node scripts/hash.mjs",
|
|
31
|
+
"salt": "node scripts/salt.mjs",
|
|
23
32
|
"prepare": "husky install"
|
|
24
33
|
},
|
|
25
34
|
"dependencies": {
|
package/scripts/compare.mjs
CHANGED
package/scripts/hash.mjs
CHANGED
package/scripts/salt.mjs
CHANGED
package/utils/common.mjs
CHANGED