Skip to content

Commit ed8d5bf

Browse files
committed
2.0.0-1
1 parent 13539d6 commit ed8d5bf

69 files changed

Lines changed: 65989 additions & 69507 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

mfkdf.js

Lines changed: 65890 additions & 69408 deletions
Large diffs are not rendered by default.

mfkdf.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mfkdf",
3-
"version": "2.0.0-0",
3+
"version": "2.0.0-1",
44
"description": "JavaScript Implementation of a Next-Generation Multi-Factor Key Derivation Function (MFKDF2)",
55
"main": "src/index.js",
66
"engines": {

site/docs/MFKDFDerivedKey.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,7 @@ <h5 class="h5-parameters">Parameters:</h5>
29312931
<br class="clear">
29322932

29332933
<footer>
2934-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:01:34 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
2934+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:04:03 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
29352935
</footer>
29362936

29372937
<script>prettyPrint();</script>

site/docs/classes_MFKDFDerivedKey_crypto.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ <h1 class="page-title">classes/MFKDFDerivedKey/crypto.js</h1>
104104
<br class="clear">
105105

106106
<footer>
107-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:01:34 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
107+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:04:03 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
108108
</footer>
109109

110110
<script>prettyPrint();</script>

site/docs/classes_MFKDFDerivedKey_hints.js.html

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ <h1 class="page-title">classes/MFKDFDerivedKey/hints.js</h1>
6666
* @author Vivek Nair (https://nair.me) &lt;vivek@nair.me>
6767
*/
6868

69-
const { hkdfSync } = require("crypto");
70-
const { decrypt } = require("../../crypt");
69+
const { hkdfSync } = require('crypto')
70+
const { decrypt } = require('../../crypt')
7171

7272
/**
7373
* Get a (probabilistic) hint for a factor to (usually) help verify which factor is wrong.
@@ -97,47 +97,47 @@ <h1 class="page-title">classes/MFKDFDerivedKey/hints.js</h1>
9797
* @memberOf MFKDFDerivedKey
9898
* @async
9999
*/
100-
function getHint(factor, bits = 7) {
101-
if (typeof factor !== "string" || factor.length === 0) {
102-
throw new TypeError("factor id must be a non-empty string");
100+
function getHint (factor, bits = 7) {
101+
if (typeof factor !== 'string' || factor.length === 0) {
102+
throw new TypeError('factor id must be a non-empty string')
103103
}
104-
if (typeof bits !== "number" || bits &lt; 1 || bits > 256) {
105-
throw new TypeError("bits must be a number between 1 and 256");
104+
if (typeof bits !== 'number' || bits &lt; 1 || bits > 256) {
105+
throw new TypeError('bits must be a number between 1 and 256')
106106
}
107107

108108
// get factor data
109-
const factorData = this.policy.factors.find((f) => f.id === factor);
109+
const factorData = this.policy.factors.find((f) => f.id === factor)
110110
if (!factorData) {
111-
throw new RangeError("factor id not found in policy");
111+
throw new RangeError('factor id not found in policy')
112112
}
113-
const pad = Buffer.from(factorData.secret, "base64");
113+
const pad = Buffer.from(factorData.secret, 'base64')
114114
const secretKey = Buffer.from(
115115
hkdfSync(
116-
"sha256",
116+
'sha256',
117117
this.key,
118-
Buffer.from(factorData.salt, "base64"),
119-
"mfkdf2:factor:secret:" + factorData.id,
118+
Buffer.from(factorData.salt, 'base64'),
119+
'mfkdf2:factor:secret:' + factorData.id,
120120
32
121121
)
122-
);
123-
const factorMaterial = decrypt(pad, secretKey);
122+
)
123+
const factorMaterial = decrypt(pad, secretKey)
124124
const buffer = Buffer.from(
125125
hkdfSync(
126-
"sha256",
126+
'sha256',
127127
factorMaterial,
128-
Buffer.from(factorData.salt, "base64"),
129-
"mfkdf2:factor:hint:" + factorData.id,
128+
Buffer.from(factorData.salt, 'base64'),
129+
'mfkdf2:factor:hint:' + factorData.id,
130130
32
131131
)
132-
);
132+
)
133133

134134
const binaryString = [...buffer]
135-
.map((byte) => byte.toString(2).padStart(8, "0"))
136-
.reduce((acc, bits) => acc + bits, "");
135+
.map((byte) => byte.toString(2).padStart(8, '0'))
136+
.reduce((acc, bits) => acc + bits, '')
137137

138-
return binaryString.slice(-1 * bits);
138+
return binaryString.slice(-1 * bits)
139139
}
140-
module.exports.getHint = getHint;
140+
module.exports.getHint = getHint
141141

142142
/**
143143
* Add a (probabilistic) hint for a factor to (usually) help verify which factor is wrong.
@@ -177,12 +177,12 @@ <h1 class="page-title">classes/MFKDFDerivedKey/hints.js</h1>
177177
* @memberOf MFKDFDerivedKey
178178
* @async
179179
*/
180-
function addHint(factor, bits = 7) {
181-
const hint = this.getHint(factor, bits);
182-
const factorData = this.policy.factors.find((f) => f.id === factor);
183-
factorData.hint = hint;
180+
function addHint (factor, bits = 7) {
181+
const hint = this.getHint(factor, bits)
182+
const factorData = this.policy.factors.find((f) => f.id === factor)
183+
factorData.hint = hint
184184
}
185-
module.exports.addHint = addHint;
185+
module.exports.addHint = addHint
186186
</code></pre>
187187
</article>
188188
</section>
@@ -197,7 +197,7 @@ <h1 class="page-title">classes/MFKDFDerivedKey/hints.js</h1>
197197
<br class="clear">
198198

199199
<footer>
200-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:01:34 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
200+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:04:03 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
201201
</footer>
202202

203203
<script>prettyPrint();</script>

site/docs/classes_MFKDFDerivedKey_index.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ <h1 class="page-title">classes/MFKDFDerivedKey/index.js</h1>
137137
<br class="clear">
138138

139139
<footer>
140-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:01:34 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
140+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:04:03 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
141141
</footer>
142142

143143
<script>prettyPrint();</script>

site/docs/classes_MFKDFDerivedKey_mfdpg.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ <h1 class="page-title">classes/MFKDFDerivedKey/mfdpg.js</h1>
121121
<br class="clear">
122122

123123
<footer>
124-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:01:34 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
124+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:04:03 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
125125
</footer>
126126

127127
<script>prettyPrint();</script>

site/docs/classes_MFKDFDerivedKey_persistence.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h1 class="page-title">classes/MFKDFDerivedKey/persistence.js</h1>
115115
<br class="clear">
116116

117117
<footer>
118-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:01:34 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
118+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Sep 12 2025 15:04:03 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
119119
</footer>
120120

121121
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)