paint-brush
Generating 2FA One-Time Passwords in JS Using Web Crypto APIby@khovansky
101 reads

Generating 2FA One-Time Passwords in JS Using Web Crypto API

by Alexander Khovansky11mAugust 15th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

There are two types of OTP-based 2FA: HOTP and TOTP. HMAC-based OTP is a way of proving that a message came from the expected sender and not someone else. HOTP is calculated based on 2 values: secret key shared between client and server, counter or moving factor. Counter is an 8-byte value that is synchronized between the server and client. It will be constantly updated as you generate passwords. In HOTP, client counter is incremented each time a new password is generated and server counter is updated.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Generating 2FA One-Time Passwords in JS Using Web Crypto API
Alexander Khovansky HackerNoon profile picture
Alexander Khovansky

Alexander Khovansky

@khovansky

L O A D I N G
. . . comments & more!

About Author

Alexander Khovansky HackerNoon profile picture
Alexander Khovansky@khovansky

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here