@1auth/crypto 0.0.0-alpha.30 → 0.0.0-alpha.32
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/index.js +4 -3
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -13,10 +13,11 @@ import { hash as secretHash, verify as secretVerify } from '@node-rs/argon2'
|
|
|
13
13
|
|
|
14
14
|
const options = {
|
|
15
15
|
// randomBytes(32).toString('hex') // 256 bits
|
|
16
|
+
encryptionContextKey: null,
|
|
16
17
|
encryptionSharedKey: '',
|
|
17
18
|
encryptionMethod: 'chacha20-poly1305', // AES-256 GCM (aes-256-gcm) or ChaCha20-Poly1305 (chacha20-poly1305)
|
|
18
19
|
|
|
19
|
-
digestAlgorithm: 'sha3-
|
|
20
|
+
digestAlgorithm: 'sha3-384',
|
|
20
21
|
digestSalt: ''
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -384,14 +385,14 @@ export const makeAsymmetricKeys = async (encryptionKey) => {
|
|
|
384
385
|
return { publicKey, privateKey }
|
|
385
386
|
}
|
|
386
387
|
|
|
387
|
-
export const makeSignature = (data, privateKey, algorithm = 'SHA3-
|
|
388
|
+
export const makeSignature = (data, privateKey, algorithm = 'SHA3-384') => {
|
|
388
389
|
return sign(algorithm, Buffer.from(data), privateKey).toString('base64')
|
|
389
390
|
}
|
|
390
391
|
export const verifySignature = (
|
|
391
392
|
data,
|
|
392
393
|
publicKey,
|
|
393
394
|
signature,
|
|
394
|
-
algorithm = 'SHA3-
|
|
395
|
+
algorithm = 'SHA3-384'
|
|
395
396
|
) => {
|
|
396
397
|
return verify(
|
|
397
398
|
algorithm,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1auth/crypto",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"url": "https://github.com/willfarrell/1auth/issues"
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/willfarrell/1auth",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3750bef3d7e376c48f7d680e5f2181ee809213b9",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@node-rs/argon2": "1.8.
|
|
49
|
+
"@node-rs/argon2": "1.8.3"
|
|
50
50
|
}
|
|
51
51
|
}
|