How to use the util function from tweetnacl

Find comprehensive JavaScript tweetnacl.util code examples handpicked from public code repositorys.

-1
fork icon0
star icon0
watch icon2

+ 41 other calls in file

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) {
fork icon0
star icon0
watch icon0

+ 23 other calls in file