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
1 parent 5d00dd9 commit 6979f94Copy full SHA for 6979f94
.gitignore
@@ -5,3 +5,4 @@
5
node_modules
6
7
.DS_Store
8
+.idea/
lib/main.js
@@ -237,9 +237,9 @@ function decrypt (encrypted, keyStr) {
237
const key = Buffer.from(keyStr.slice(-64), 'hex')
238
let ciphertext = Buffer.from(encrypted, 'base64')
239
240
- const nonce = ciphertext.slice(0, 12)
241
- const authTag = ciphertext.slice(-16)
242
- ciphertext = ciphertext.slice(12, -16)
+ const nonce = ciphertext.subarray(0, 12)
+ const authTag = ciphertext.subarray(-16)
+ ciphertext = ciphertext.subarray(12, -16)
243
244
try {
245
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)
0 commit comments