mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-21 22:18:58 -04:00
improving tests, correcting cipher
This commit is contained in:
parent
0dbbb61d11
commit
b97ac08003
4 changed files with 11 additions and 20 deletions
|
@ -764,7 +764,8 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||
derivedKey,
|
||||
StrToArr(compress(message)) // compressed plain text to encrypt
|
||||
)
|
||||
return btoa(ArrToStr(encrypted));
|
||||
object.ct = btoa(ArrToStr(encrypted));
|
||||
return JSON.stringify(object);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -780,7 +781,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||
me.decipher = async function(key, password, data)
|
||||
{
|
||||
try {
|
||||
if (password.length > 0) {
|
||||
if ((password || '').trim().length > 0) {
|
||||
key += sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(password));
|
||||
}
|
||||
var object = JSON.parse(data),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue