diff options
author | Mario Vavti <mario@mariovavti.com> | 2020-08-21 10:55:55 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2020-08-21 10:55:55 +0200 |
commit | 49df57df45f82e2e0f1b10f2508f61b78d6d3ac0 (patch) | |
tree | da108b3e816419354814b143b675a8a933364f51 /view/js | |
parent | 374c30999acb19fd9ec828a266106e11367c7584 (diff) | |
download | volse-hubzilla-49df57df45f82e2e0f1b10f2508f61b78d6d3ac0.tar.gz volse-hubzilla-49df57df45f82e2e0f1b10f2508f61b78d6d3ac0.tar.bz2 volse-hubzilla-49df57df45f82e2e0f1b10f2508f61b78d6d3ac0.zip |
use the default setting and also add the mode to the cipher. aes-128 is to be preferred over aes-256 according to bruce schneier https://www.schneier.com/blog/archives/2009/07/another_new_aes.html#c386957
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/crypto.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/view/js/crypto.js b/view/js/crypto.js index 058b769c5..98af6e09e 100644 --- a/view/js/crypto.js +++ b/view/js/crypto.js @@ -157,18 +157,18 @@ function hz_encrypt(alg, elem) { if((alg == 'rot13') || (alg == 'triple-rot13')) newdiv = "[crypt alg='rot13']" + window.btoa(str_rot13(text)) + '[/crypt]'; - if(alg == 'AES-256') { + if(alg == 'AES-128-CCM') { // This is the prompt we're going to use when the receiver tries to open it. // Maybe "Grandma's maiden name" or "our secret place" or something. var enc_hint = bin2hex(prompt(aStr['passhint'])); - enc_text = sjcl.encrypt(enc_key, text, { ks: 256 }); + enc_text = sjcl.encrypt(enc_key, text); encrypted = enc_text.toString(); - newdiv = "[crypt alg='AES-256' hint='" + enc_hint + "']" + window.btoa(encrypted) + '[/crypt]'; + newdiv = "[crypt alg='AES-128-CCM' hint='" + enc_hint + "']" + window.btoa(encrypted) + '[/crypt]'; } enc_key = ''; @@ -249,7 +249,7 @@ function hz_decrypt(alg, hint, text, elem) { var enc_key = bin2hex(prompt((hint.length) ? hex2bin(hint) : aStr['passphrase'])); } - if(alg == 'AES-256') { + if(alg == 'AES-128-CCM') { dec_text = sjcl.decrypt(enc_key, text); } |