kopia lustrzana https://github.com/robinmoisson/staticrypt
Made requested updates with calls to toString().
rodzic
3a1d8b7113
commit
a612499c9c
|
@ -19,7 +19,7 @@ try{
|
|||
}
|
||||
|
||||
var encrypted = CryptoJS.AES.encrypt(contents, namedArgs.password);
|
||||
var hmac = CryptoJS.HmacSHA256(encrypted.toString(), CryptoJS.SHA256(namedArgs.password)).toString();
|
||||
var hmac = CryptoJS.HmacSHA256(encrypted.toString(), CryptoJS.SHA256(namedArgs.password).toString()).toString();
|
||||
var encryptedMessage = hmac + encrypted;
|
||||
|
||||
var data = {
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
encryptedMsg = '{encrypted}',
|
||||
encryptedHMAC = encryptedMsg.substring(0, 64),
|
||||
encryptedHTML = encryptedMsg.substring(64),
|
||||
decryptedHMAC = CryptoJS.HmacSHA256(encryptedHTML, CryptoJS.SHA256(passphrase)).toString();
|
||||
decryptedHMAC = CryptoJS.HmacSHA256(encryptedHTML, CryptoJS.SHA256(passphrase).toString()).toString();
|
||||
|
||||
if (decryptedHMAC !== encryptedHMAC) {
|
||||
alert('Bad passphrase !');
|
||||
|
|
Ładowanie…
Reference in New Issue