Hi everyone. I used crypto-js to encrypt on the client: {code ...} server: {code ...} this prevents decryption. is there any way for you to use the 3DESECB mode encryption on the client, and the backend can be decrypted? Hi everyone.
I used crypto-js to encrypt on the client:
function encrypt(str) { var key = $.cookie('key'); var encrypted = CryptoJS.TripleDES.encrypt(str, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.ZeroPadding}); return encrypted;}
Server:
$decrypt = mcrypt_decrypt (MCRYPT_3DES, $_SESSION['key'], $encrypted_str_from_client, MCRYPT_MODE_ECB); print ($decrypt);
This prevents decryption.
Is there any way to use the 3DES ECB mode for encryption on the client, and the backend can be decrypted?
Reply content:
Hi everyone.
I used crypto-js to encrypt on the client:
function encrypt(str) { var key = $.cookie('key'); var encrypted = CryptoJS.TripleDES.encrypt(str, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.ZeroPadding}); return encrypted;}
Server:
$decrypt = mcrypt_decrypt (MCRYPT_3DES, $_SESSION['key'], $encrypted_str_from_client, MCRYPT_MODE_ECB); print ($decrypt);
This prevents decryption.
Is there any way to use the 3DES ECB mode for encryption on the client, and the backend can be decrypted?