Note that there are some explanatory texts on larger screens.

plurals
  1. POBase64 encode: Three different outputs from different tools?
    primarykey
    data
    text
    <p>I am trying to verify an OAuth signature generated in code against a "known reputable source". All my steps are verified correct except the last, wherein a 'base signature string' is HMAC-SHA1 hashed against a secret key and then base64 encoded.</p> <p>I have confirmed that my hash value is the same as expected by the algorithm. I then disconfirmed that my base64 encode was the same. Attempting to determine why my encode failed, I wanted to check the encoder I was using.</p> <p>Here is the (hash) string being base64 encoded:</p> <blockquote> <p>203ebb13a65cccaae5cb1b9d5af51fe41f534357</p> </blockquote> <p>Here is the base64 encode that results in my code:</p> <blockquote> <p>MjAzZWJiMTNhNjVjY2NhYWU1Y2IxYjlkNWFmNTFmZTQxZjUzNDM1Nw==</p> </blockquote> <p>According to <a href="http://www.motobit.com/util/base64-decoder-encoder.asp" rel="nofollow noreferrer">http://www.motobit.com/util/base64-decoder-encoder.asp</a>, that is the correct result:</p> <blockquote> <p><img src="https://i.imgur.com/upYI2.png" alt="Base64 1"></p> </blockquote> <p>But, according to <a href="http://www.online-convert.com/result/096d7b00138f3726daee5f6ddb107a62" rel="nofollow noreferrer">http://www.online-convert.com/result/096d7b00138f3726daee5f6ddb107a62</a> (provided with the secret and base string, not the hash), a different base64 should have been output. Note that the hash output is my correct hash despite the difference in base64:</p> <blockquote> <p><img src="https://i.imgur.com/yZfjZ.png" alt="Base64 1"></p> </blockquote> <p>Finally, the "official" tester (<a href="http://hueniverse.com/oauth/guide/authentication/" rel="nofollow noreferrer">http://hueniverse.com/oauth/guide/authentication/</a>) outputs a <em>third</em> different base64 from the same hash:</p> <blockquote> <p><img src="https://i.imgur.com/zgLmC.png" alt="Base64 1"></p> </blockquote> <p>I have no idea what I'm doing wrong, and the fact that these tools are outputting different results makes me wonder if there is in fact such a thing as base64 encoding or if they are actually using different algorithms? Perhaps the fact that it's for OAuth would help you help me identify the answer.</p> <p>Thanks for any leads from the wise.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload