Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Problems with HMAC SHA-256

by marto (Cardinal)
on Mar 07, 2014 at 16:25 UTC ( [id://1077413]=note: print w/replies, xml ) Need Help??


in reply to Problems with HMAC SHA-256

The documentation is pretty clear about how to calculate using the hmac algorithms:

#!/usr/bin/perl use warnings; use strict; use Digest::SHA qw(hmac_sha256_hex); my $digest=hmac_sha256_hex("138539083512345apiKeyDEMO","apiSecretDEMO" +); print "Digest=$digest\n";

Update: output:

Digest=696e087f4b1902aa58d35e75b4600580d70a92ed68b23379373117fb3fe3064 +a

Replies are listed 'Best First'.
Re^2: Problems with HMAC SHA-256
by agnome (Initiate) on Mar 07, 2014 at 18:47 UTC

    Thanks very much to everyone for the prompt replies. You are of course correct, I should have used hmac_sha256_hex instead of just sha256_hex if I want to include my own encryption key as the last argument. Otherwise, as pointed out, it just combines all the arguments into one string and then uses its own key.

    Thanks once again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1077413]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found