ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere DataPowerUsing hmac-sha256

Post new topicReply to topic
Using hmac-sha256 View previous topic :: View next topic
Author Message
blink
PostPosted: Tue Aug 22, 2017 11:08 am Post subject: Using hmac-sha256 Reply with quote

Newbie

Joined: 22 Aug 2017
Posts: 2

At a high level i'm looking for a way to mimic the hmac-sha256 function used in JavaScript.

The JS version allows for a secret key which is not a 256 bit value e.g. "mysecretkey". However the DP version only allows 256 bit keys.

How I can use my custom key with the DP hmac-sha256 even when it's not a 256 bit value?
Back to top
View user's profile Send private message
blink
PostPosted: Tue Aug 22, 2017 11:10 am Post subject: Using hmac-sha256 Reply with quote

Newbie

Joined: 22 Aug 2017
Posts: 2

Here is the associated code to help clarify what I'm trying to do:

DP code:
Code:

var keyBuf = new Buffer("mysecretkey");
var hmac = crypto.createHmac('hmac-sha256', keyBuf); // this fails because keyBuf not 256 bits
var hmac_result = hmac.update(“Message”).digest('base64');
console.debug('hmac_results:' + hmac_result);


JS code:
Code:

var hash = CryptoJS.HmacSHA256("Message","mysecretkey");  / /this succeeds
var results = CryptoJS.enc.Base64.stringify(hash);
Back to top
View user's profile Send private message
ronaldben
PostPosted: Wed Apr 17, 2019 12:02 pm Post subject: Using hmac sha256 Reply with quote

Newbie

Joined: 11 Apr 2019
Posts: 1
Location: Turkey

So, just in case I cant get any useful information out of Amazon, is there some way I can decode the signature that their MWS Scratchpad app gives me - it was created with I think my AWS Access Key ID and some mystery string. The Scratchpad gives me a value for "SHA 256 HMAC" some big long incoherent string and "Base64 HMAC" which is the value used for the Signature parameter.

Is there some way to take my AWS Access Key ID and one of the values they give me to decode the original string so I can look at it in text format? If I had that, I think I might be able to finish my app pretty quickly.
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere DataPowerUsing hmac-sha256
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.