Do you think mcrypt is too difficult to use?
am 07.09.2007 17:39:55 von howa
php mcrypt is perhaps the most difficult to use modules, e.g.
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
broken into too many steps which is error prone...
Re: Do you think mcrypt is too difficult to use?
am 07.09.2007 17:47:45 von gosha bine
On 07.09.2007 17:39 howa wrote:
> php mcrypt is perhaps the most difficult to use modules, e.g.
>
>
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
>
> $td = mcrypt_module_open('tripledes', '', 'ecb', '');
> $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
> mcrypt_generic_init($td, $key, $iv);
> $encrypted_data = mcrypt_generic($td, $input);
> mcrypt_generic_deinit($td);
> mcrypt_module_close($td);
>
>
> broken into too many steps which is error prone...
>
Nothing stops you from writing a nice, concise, well documented object
oriented frontend for it. ;))
--
gosha bine
makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi