C & PHP library HMAC differences

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
Stefano
Posts: 1
Joined: Mon Sep 04, 2017 10:27 am

C & PHP library HMAC differences

Post by Stefano »

Hi,

I've been having a few problems with the C and PHP libraries.
I'm adapting the C code to work on iOS and when encrypting and decrypting files everything works, if I pass the file to another service that uses the PHP library (philios33) however the calculated hmac value isn't the same when the library hits the doDecryptFile method and subsequently call the $this->validateHMAC($enc_key_1, $enc_keys, $hmac_1, "HMAC 1") method on line 459.

Has anyone had this problem before or can anyone point me in the right direction?

Thanks in advance,
Stefano
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: C & PHP library HMAC differences

Post by paulej »

Which C code are you using? There is "AES String Crypt" (or whatever I called it) that only produces a version 0 file format. And I think the Python code does not support version 0. But, if you're using the regular "AES Crypt" C source used for Linux and Mac builds, then the output is the latest file format and I believe the PHP code supports that. But, file format versions is the first thing I'd check, since those kind of calculations change between versions.
Post Reply