Skip to content

Commit

Permalink
Merge pull request #14 from jubal-R/master
Browse files Browse the repository at this point in the history
Changed encryption mode from CCM to GCM
  • Loading branch information
Kage authored Mar 10, 2018
2 parents 684687f + 5a5e6ea commit 39f1855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/js/newpaste.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ $(document).ready(function() {
setFormReadonly(true);

// Encrypt the plain text using the password to a Base64 string
var enc_paste = sjcl.codec.base64.fromBits(sjcl.codec.utf8String.toBits(sjcl.encrypt($("#password").val(), original, {ks: 256})));
var enc_paste = sjcl.codec.base64.fromBits(sjcl.codec.utf8String.toBits(sjcl.encrypt($("#password").val(), original, {mode:"gcm", ks: 256})));
$("#paste").val(enc_paste);

// Check that the paste text is below the maximum character limit
Expand Down
2 changes: 1 addition & 1 deletion public/js/viewpaste.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ $(document).ready(function() {
// Attempt to decrypt paste
try {
// Decrypt, escape, and set paste
var decrypted = sjcl.decrypt($("#password").val(), sjcl.codec.utf8String.fromBits(sjcl.codec.base64.toBits($("#paste").html())), {ks: 256});
var decrypted = sjcl.decrypt($("#password").val(), sjcl.codec.utf8String.fromBits(sjcl.codec.base64.toBits($("#paste").html())));
cleaned_paste = decrypted.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
$("#paste").html(cleaned_paste);

Expand Down

0 comments on commit 39f1855

Please sign in to comment.