Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decoding Google 2 Factor Authentication QR Code Format

According to wiki, google 2 factor authentication secret key is supposed to be a 16 character base32 string. When I decode the QR Code that google sent me, I find that it complies with the Key format specified by google, but I find that the secret length is not right. Has google changed the secret length or encoding format? Is there any way for me to get the 16 character base32 string from the secret key I have? My key from the QR code (which I obviously am not copying and pasting exactly) is:

otpauth://totp/Google%3Amyemail%40gmail.com?secret=7gmdmzctmhpm7i6nrmbom6u5gny7o6la&issuer=Google

Here's what I know:

  1. It isn't hex.
  2. It is 32 characters long.
  3. It does comply with base32, but why is it all lower case? The example on google's key format specification showed it all uppercase?

The only thing I can imagine is that google has changed the format from only 16 characters to 32 characters. Does anyone know about this?

like image 931
PressingOnAlways Avatar asked Aug 17 '26 03:08

PressingOnAlways


1 Answers

The length of the secret is only 16 characters which are all one case.

It doesn't matter if it is a lowercase a or uppercase A as it translates into the same bit.

like image 87
Kraang Prime Avatar answered Aug 20 '26 00:08

Kraang Prime



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!