diff --git a/nip04.js b/nip04.js index 4c0b011..c1afa37 100644 --- a/nip04.js +++ b/nip04.js @@ -29,7 +29,7 @@ export function decrypt(privkey, pubkey, ciphertext) { Buffer.from(normalizedKey, 'hex'), Buffer.from(iv, 'base64') ) - let decryptedMessage = decipher.update(cip, 'base64') + let decryptedMessage = decipher.update(cip, 'base64', 'utf8') decryptedMessage += decipher.final('utf8') return decryptedMessage