Jump to content

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


Radix
 Share

Go to solution Solved by Radix,

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

No worries, @Radix it happens :)

And no need to create another, I have merged the two.

Edited by JLogan3o13

"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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Solution

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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...