Encryption in JavaScript and decryption with PHP
I'm encrypting my user password in JavaScript like this: var encryptedPassword = CryptoJS.AES.encrypt(password, "Secret Passphrase"); It works fine but now I'm trying to decrypt in PHP on the server side like this: $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); $decryptPassword = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, "Secret Passphrase", base64_decode($password), MCRYPT_MODE_CBC, $iv); it doesn't works at all, the decrypted password string looks very strange: string(64) ">�OX2MS��댗v�<$�ʕ��i�̄��_��P���\�կ=�_6(�m����,4WT7��a" Here is the current