4 responses to “How to calculate a Base64 encoded HMAC-SHA1 in PHP for OAuth”

  1. rednael says:

    Please also read the following article: http://blog.rednael.com/2008/09/30/SecuringYourPasswordTransfersWithKeyedHashingHMACCramMD5.aspx

    It’s a walkthrough example of implementing HMAC-MD5 / Cram-MD5 on a website. The same technique can be used for various client-server situations. The article explains the benefits of using such a password system and shows you how to implement it using the .Net library at server side (examples in C#), and using Paj’s MD5 Javascript functions at client-side.

  2. Serban says:

    Thanks for posting the hmacsha1() function! Very useful!

  3. Lech says:

    Thank you!