Ankur Motreja - 2009-02-13

Hi,

I am trying to make a pure php implementation of AES 128 (http://www.phpclasses.org/browse/package/3650.html) behave like mcrypt on all inputs.
This is so that I can use the pure php implementation on servers where mcrypt is not activated in the php installation.

I have got it working with key sizes less than and equal to 16 bytes.
However, mcrypt seems to be using some way to reduce a key longer than 16 bytes to a 16 byte key, and I'm not able to figure out what method is used.

Can anyone let me know how mcrypt obtains a 16 byte key when given a key longer than 16 bytes when using AES 128 (rijndael-128) ?
Any help will be appreciated.

Thanks,
Ankur