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.