Coder Social home page Coder Social logo

otp's People

Contributors

alexxandergrib avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

otp's Issues

Functions to encode/decode secret

Hello @AlexXanderGrib

I came across your project and I have to say that it deserves far more love and consideration. Most of otp projects are unmaintained or bad designed, when yours is fast, efficient and clean. I'll start to use it soon in a production app.

If I open this post, apart from congratulating you, is that I would like to see functions to encode/decode the secret generated from generateKey.

Currently the process is pretty simple, we generate a key with generateKey, create the totp URL with getKeyUri (and in this process I believe that you convert the Uint8Array bytes from generateKey to the string secret we can see in the built URL).

For now I JSON.stringify the result of generateKey to get a storable secret to keep it linked to the user, and then I reconstruct the Uint8Array from an iterable function when I need it, it works pretty well but I find it ugly. I'd like to be able to go from the bytes generated by generateKey to the string secret in the totp URL and back to the Uint8Array.

It would be cleaner I think to store the secret as it is in the URL and then be able to challenge the code given by the user from this string secret.

Again congratulations for this project, I wish you the best !

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.