Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds PHP implementation of client-side OTP check #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

egrim
Copy link
Member

@egrim egrim commented May 31, 2013

No description provided.

Verified

This commit was signed with the committer’s verified signature.
sunsided Markus Mayer

}

public static function oathTruncate($hash, $otpLength)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? I see a lot of bit manipulation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best explanation is http://en.wikipedia.org/wiki/HMAC-based_One-time_Password_Algorithm. Truncate is:

a function that selects 4 bytes from the result of the HMAC in a defined manner

This implementation is just a php port of the truncate algorithm from the oath reference implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants