Hi

I think you may have the incorrect expected value.

When using http://www.freeformatter.com/hmac-generator.html and entering 
“testpharmprescriptionsgetexecuted1403122014500” as message and 
“veQC+IBLq5qMO8oGcQupjg==“ as key, I get 
“01c4d717e9436b69116159b49398d8ea91864cc5c3ecdb104bab4b057469dd7b” hex output.
When I then enter this hex output into 
http://tomeko.net/online_tools/hex_to_base64.php?lang=en the generated base64 
is: 
AcTXF+lDa2kRYVm0k5jY6pGGTMXD7NsQS6tLBXRp3Xs=
which is identical to the Pharo generated output:
AcTXF+lDa2kRYVm0k5jY6pGGTMXD7NsQS6tLBXRp3Xs=

The ‘+’ and ‘=“ are the only 2 characters that would be encoded for HTTP which 
would mean the Pharo generated output is correct: 
AcTXF%2BlDa2kRYVm0k5jY6pGGTMXD7NsQS6tLBXRp3Xs%3D

Are you sure that your expected output is correct: 
%2B%2FYhVkcaEIHBeUESOsJYD1nKyJXVGyFX%2FlxR616aUK4%3D

Cheers
Carlo


On 28 Apr 2014, at 11:42 PM, Spiliosv <spili...@gmail.com> wrote:

Dear Sven,

I tried but still no luck. In any case the padding you are referring to is
for the key for the SHA256 encryption.
I have tested in the
'https://www.freeformatter.com/hmac-generator.html#ad-output' that the hex
values produced from my SHA256 operation are the same. Maybe the conversion
byteArray is wrong?
The correct result for the 'encodedSignature base64Encoded encodeForHTTP. '
should be '%2B%2FYhVkcaEIHBeUESOsJYD1nKyJXVGyFX%2FlxR616aUK4%3D''. This
result is added to a url request as the signature.

Any other suggestions?

Spilios





--
View this message in context: 
http://forum.world.st/Base64-or-HMAC-problem-tp4756788p4756864.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Reply via email to