You are here: equivalent of mysql aes_decrypt in php? « PHP Programming Language « IT news, forums, messages
equivalent of mysql aes_decrypt in php?

Posted by veg_all on 12/17/79 11:53

I am using AES_DECRYPT and AES_DECRYPT to store my datat in mysql
databases. I want to be able to download these as csv files and have a
php script decrypt them. I can use bin2hex to convert to text , but I
cant figure out how to decrypt the hex to plaintext using php? I have
tried this without success, as AES is not recognized.

$input = 'some encrypted data in hexadecimal';

$len = strlen ( $input );
$input = pack("H" . $len, $input );

$td = mcrypt_module_open( 'AES' , '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND );
mcrypt_generic_init($td, $key, $iv);

$decrypted = mdecrypt_generic($td, $input );

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация