How to use the util function from tweetnacl
Find comprehensive JavaScript tweetnacl.util code examples handpicked from public code repositorys.
110 111 112 113 114 115 116 117 118 119 120 121
KeyStore._encryptString = function (string, pwDerivedKey) { var nonce = nacl.randomBytes(nacl.secretbox.nonceLength); var encObj = nacl.secretbox(nacl.util.decodeUTF8(string), nonce, pwDerivedKey); var encString = { 'encStr': nacl.util.encodeBase64(encObj), 'nonce': nacl.util.encodeBase64(nonce)}; return encString; }; KeyStore._decryptString = function (encryptedStr, pwDerivedKey) {
0
0
0
+ 23 other calls in file
tweetnacl.box is the most popular function in tweetnacl (320 examples)