return array ( 'crypto_key' => 'secret', 'crypto_iv' => 'secret', 'crypto_hmac' => 'secret', );
var encrypted = CryptoJS.AES.encrypt("Message", "secret"); //do some AJAX stuff here and send to server
$encrypted_string = Input::post('some_var'); $value = Crypt::decode($encrypted_string, 'secret');
Harro Verton wrote on Tuesday 31st of July 2012:The Crypt class uses base64_encode()/decode() to make sure the crypted result is a readable string that can be manupulated. So after encrypting your code must base64_encode() it using the same rules as the Crypt class ( check out the safe_b64encode()/safe_b64decode() methods ). But isn't this a rather pointless and even dangerous route you're taking? To be able to AES encrypt in you js, you will need to send the crypto keys to the client, visible for everyone to see. Which will also compromise all encryption in your app...
It looks like you're new here. If you want to get involved, click one of these buttons!