security - AES-256 encryption in PHP -


i need php function, aes256_encode($datatoecrypt) encrypt $data aes-256 , 1 aes256_decode($encrypteddata) opposite. know code should functions have?

look @ mcrypt module

aes-rijndael example taken here

$iv_size = mcrypt_get_iv_size(mcrypt_rijndael_128, mcrypt_mode_cbc); $iv = mcrypt_create_iv($iv_size, mcrypt_dev_urandom); $key = pack('h*', "bcb04b7e103a0cd8b54763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3"); # show key size use either 16, 24 or 32 byte keys aes-128, 192 # , 256 respectively $key_size =  strlen($key); echo "key size: " . $key_size . "\n"; $text = "meet me @ 11 o'clock behind monument."; echo strlen($text) . "\n";  $crypttext = mcrypt_encrypt(mcrypt_rijndael_128, $key, $text, mcrypt_mode_cbc, $iv); echo strlen($crypttext) . "\n"; 

this decrypt function


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -