aboutsummaryrefslogtreecommitdiff
path: root/bog.js
diff options
context:
space:
mode:
Diffstat (limited to 'bog.js')
-rw-r--r--bog.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/bog.js b/bog.js
index e9477ed..55188e5 100644
--- a/bog.js
+++ b/bog.js
@@ -76,7 +76,7 @@ async function unbox (boxed, sender, keys) {
var nonceMsg = nacl.util.decodeBase64(boxed)
var nonce = nonceMsg.slice(0, nacl.box.nonceLength)
var msg = nonceMsg.slice(nacl.box.nonceLength, nonceMsg.length)
- var message = nacl.box.open(msg, nonce, ed2curve.convertPublicKey(nacl.util.decodeBase64(sender.substring(1))), ed2curve.convertSecretKey(nacl.util.decodeBase64(keys.privateKey)))
+ var message = nacl.util.encodeUTF8(nacl.box.open(msg, nonce, ed2curve.convertPublicKey(nacl.util.decodeBase64(sender.substring(1))), ed2curve.convertSecretKey(nacl.util.decodeBase64(keys.privateKey))))
return message
}