Thanx for the code samples.
I'll try rewrite it in the same way as the perl scripts
instead of reimplementing from scratch. (as soon as a learn PHP :-) )
Cheers
Paul
On Wed, 19 Jul 2000, Colin Viebrock wrote:
> > The IV is generated from the repeated md5() of the client key.
> > Look in CBC.pm for that.
>
>
> Right. Again, my perl is iffy. Have you translated that part of
> CBC.pm into PHP? Assuming DES ...
>
> function generate_iv($key) {
> $ks = mcrypt_get_key_size(MCRYPT_DES);
> $bs = mcrypt_get_block_size(MCRYPT_DES);
>
> $material = MD5($key);
> while (length($material) < $ks + $bs) {
> $material .= MD5($material);
> }
>
> $k = substr($material,0,$ks); /* what is this? */
> $iv = substr($material,$ks,$bs);
>
> return $iv;
> }
>
>
> - Colin
>
This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:35:41 EDT