Jump to content

Error calculating hmac, GUI and CLI working different - (Moved)


Go to solution Solved by Radix,

Recommended Posts

Posted (edited)

Greetings!

I'm having trouble calculating the HMAC, more precisely when I try to do it through the GUI interface. The CLI interface works and is even OpenSSL compliant, but there is something wrong reading the secret key or the target file on the GUI, which modifies the result.

I can't identify the error, it just doesn't work.

Help please!

thanks in advace

HMACCLI.au3

cmdline.au3

HMACGUI.au3

Edited by Radix
  • Moderators
Posted

Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted (edited)

Greetings!

I'm having trouble calculating the HMAC, more precisely when I try to do it through the GUI interface. The CLI interface works and is even OpenSSL compliant, but there is something wrong reading the secret key or the target file on the GUI, which modifies the result.

I can't identify the error, it just doesn't work.

Help please!

thanks in advace

HMACCLI.au3 cmdline.au3

HMACGUI.au3

Edited by Radix
Posted (edited)
1 hour ago, Radix said:

I'm having trouble calculating the HMAC, more precisely when I try to do it through the GUI interface.

 

Case $idCalculate
    $sSecret = ""
    $Full = FileRead(GUICtrlRead($idInput))
    $dHash = _HashHMAC($iAlgorithm, $Full, $sSecret); Create a hash of the file.
    GUICtrlSetData($idHashLabel, $dHash) ; Set the hash digest label with the hash data.

Do you think it might have something to do with the fact that you don't set $sSecret before calling _HashHMAC()?  ;)

 

Edited by TheXman
  • Solution
Posted

No, sorry. I wrote this line to test null key. I realized it wasn't working because I'm just running the script in Scite, instead of compiling, when there was already a compiled binary in the directory, that was probably causing the bug..

It works fine like this: (OpenSSL compliant)

gui.au3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...