We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
motdotla
Learn more about funding links in repositories.
Report abuse
2 parents 8609b84 + 6979f94 commit 0489c7dCopy full SHA for 0489c7d
.gitignore
@@ -5,3 +5,4 @@
5
node_modules
6
7
.DS_Store
8
+.idea/
lib/main.js
@@ -241,9 +241,9 @@ function decrypt (encrypted, keyStr) {
241
const key = Buffer.from(keyStr.slice(-64), 'hex')
242
let ciphertext = Buffer.from(encrypted, 'base64')
243
244
- const nonce = ciphertext.slice(0, 12)
245
- const authTag = ciphertext.slice(-16)
246
- ciphertext = ciphertext.slice(12, -16)
+ const nonce = ciphertext.subarray(0, 12)
+ const authTag = ciphertext.subarray(-16)
+ ciphertext = ciphertext.subarray(12, -16)
247
248
try {
249
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)
0 commit comments