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

Use SubtleCrypto in browser #296

Closed
socketpair opened this issue May 2, 2023 · 1 comment
Closed

Use SubtleCrypto in browser #296

socketpair opened this issue May 2, 2023 · 1 comment

Comments

@socketpair
Copy link

Use https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest when work in browser

Unfortunately it is asynchronous. Anyway, I think it is better than external crypto dependency.

@hectorm
Copy link
Owner

hectorm commented May 4, 2023

If I were writing OTPAuth today, I would probably use the Web Crypto API for this part, but as you point out, the digest method can only be used asynchronously and also supports fewer algorithms than jsSHA (although SHA1 is what is almost always used in TOTP), so making OTPAuth use it would be a breaking change, and since jsSHA currently works fine, I have no strong reason to replace it.

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

No branches or pull requests

2 participants