I am trying to interact with third party real time Web messaging System created and maintained by Pusher.com. Now, i cannot send anything through the API unless i produce an HMAC SHA256 hex digest
of my data. A sample source code written in ruby
could try to illustrate this:
# Dependencies # gem install ruby-hmac # require 'rubygems' require 'hmac-sha2' secret = '7ad3773142a6692b25b8' string_to_sign = "POST\n/apps/3/channels/test_channel/events\nauth_key=278d425bdf160c739803&auth_timestamp=1272044395&auth_version=1.0&body_md5=7b3d404f5cde4a0b9b8fb4789a0098cb&name=foo" hmac = HMAC::SHA256.hexdigest(secret, string_to_sign) puts hmac # >> 309fc4be20f04e53e011b00744642d3fe66c2c7c5686f35ed6cd2af6f202e445
I checked the erlang crypto Library and i cannot even generate a SHA256 hex digest
"directly"
How do i do this whole thing in Erlang ? help....
* UPDATE *
I have found solutions here: sha256 encryption in erlang and they have led me to erlsha2. But still, how do i generate the HMAC
of a SHA256 hexdigest
output from this module ?