Page 1 of 1

C & PHP library HMAC differences

Posted: Mon Sep 04, 2017 12:26 pm
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

Re: C & PHP library HMAC differences

Posted: Wed Sep 06, 2017 8:07 pm
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.