[GH-ISSUE #41] Use a more secure Base32 encoding algorithm #251

Closed
opened 2026-03-01 17:48:39 +03:00 by kerem · 4 comments
Owner

Originally created by @cwt137 on GitHub (Jul 28, 2016).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/41

Please use the paragonie/constant_time_encoding Composer package for doing Base32 encoding. It helps to prevent cache-timing attacks.

Originally created by @cwt137 on GitHub (Jul 28, 2016). Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/41 Please use the paragonie/constant_time_encoding Composer package for doing Base32 encoding. It helps to prevent cache-timing attacks.
kerem closed this issue 2026-03-01 17:48:39 +03:00
Author
Owner

@aik099 commented on GitHub (Jul 28, 2016):

@cwt137 , please explain how base32 operations can be used to compromise library?

<!-- gh-comment-id:235913246 --> @aik099 commented on GitHub (Jul 28, 2016): @cwt137 , please explain how base32 operations can be used to compromise library?
Author
Owner

@aik099 commented on GitHub (Jul 28, 2016):

Currently base32 is used to generate 5 OTP codes, that are compared with user provided OTP code using hash_equals (timing attack safe) function. If I'm not mistaken, then time how long it takes to generate these 5 OTP codes can't be used to perform Timing Attack (I guess that's what you're worried about).

<!-- gh-comment-id:235916796 --> @aik099 commented on GitHub (Jul 28, 2016): Currently base32 is used to generate 5 OTP codes, that are compared with user provided OTP code using `hash_equals` (timing attack safe) function. If I'm not mistaken, then time how long it takes to generate these 5 OTP codes can't be used to perform Timing Attack (I guess that's what you're worried about).
Author
Owner

@cwt137 commented on GitHub (Jul 29, 2016):

It is the generation of the secret key that is susceptible to a timing attack and should use constant time base32 encoding

<!-- gh-comment-id:236077895 --> @cwt137 commented on GitHub (Jul 29, 2016): It is the generation of the secret key that is susceptible to a timing attack and should use constant time base32 encoding
Author
Owner

@antonioribeiro commented on GitHub (Jun 17, 2017):

Done.
Sorry for the huge delay.
Thank you!

<!-- gh-comment-id:309193620 --> @antonioribeiro commented on GitHub (Jun 17, 2017): Done. Sorry for the huge delay. Thank you!
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/google2fa#251
No description provided.