Hi Spilios, There is not enough information in your mail.
Where exactly did you load SHA256 from and how ? What are the correct/incorrect answers that you get ? From where do you get the references values ? How sure are you they are correct ? If you make it easy for others to execute the same expression as you do, you'll get a better answer. Sven On 28 Apr 2014, at 17:11, Spiliosv <spili...@gmail.com> wrote: > Dear all, > > I am currently having an issue on Pharo 2.0 for windows in using HMAC > encryption and subsequent bas64 encoding. > > I have loaded the cryptography library from smalltalkhub, but I do not get > appropriate results when using the code below: > > encodedSignature := (SHA256 new) hmac key: apiKey asByteArray; > digestMessage: unsignedSignature asByteArray. > encodedSignature base64Encoded encodeForHTTP. > > With values: > apiKey := '123456789'. > unsignedSignature := 'pharmacistprescriptionsget000001'. > the result obtained is correct. > > But with values > apiKey := 'veQC+IBLq5qMO8oGcQupjg=='. > userName := 'testpharm'. > barCode :='1403122014500'. > unsignedSignature := userName,'prescriptionsgetexecuted',barCode. > the result is not correct. > > What am I doing wrong or I do not understand correctly? > > Kind regards, > Spilios > > > > -- > View this message in context: > http://forum.world.st/Base64-or-HMAC-problem-tp4756788.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. >