TheDude
TheDude

Reputation: 3105

Decrypt Files in PHP (RIJNDAEL / sha 512)

I have a pascal code that encrypts files using RIJNDAEL / sha 512 and send them to server, where they stay encrypted.

When a user request an encrypted file, I have to decrypt them using PHP.

The problem is: it seems that PHP only support to up RIJNDAEL 256, I found reference on the internet suggesting that only RIJNDAEL 128 is considered compatible with AES.

My question is: is there a way to decrypt these files in PHP using RIJNDAEL / sha 512? Or should I just "downgrade" the encryption to RIJNDAEL 128/256?

Ideally I'd like the most secure encryption. I do have the choice in Delphi as I'm using a library that offer pretty much all popular encryption methods, but the issue is how to find an encryption method that's both very secure and handled by PHP.

Thanks!

PS. please keep in mind that I'm a newbie when it comes to encryption!

Upvotes: 1

Views: 1503

Answers (1)

poupou
poupou

Reputation: 43553

The problem is: it seems that PHP only support to up RIJNDAEL 256, I found reference on the internet suggesting that only RIJNDAEL 128 is considered compatible with AES.

You're confusing the block size with the key size.

AES supports 128, 192 and 256 bits keys with a 128 bits block size.

Rijndael also supports 192 and 256 bits block size - but those are generally not used by default (e.g. in .NET) so it should not be an issue to interoperate between PHP and Delphi - review the source code to be sure and try it out :-)

Upvotes: 1

Related Questions