Giter VIP home page Giter VIP logo

Comments (4)

ajvb avatar ajvb commented on June 8, 2024

I don't think you can encrypt that secret in that way, as you will need it to authenticate them.

valid := totp.Validate(passcode, key.Secret())

I believe you will want to just store it as is.

from pursuance.

elimisteve avatar elimisteve commented on June 8, 2024

@ajvb What I'm saying is:

  1. Go server starts up
  2. We securely, interactively give it a long passphrase (using gopass, or maybe it tries grabbing its passphrase over SSL from a key server of course that will only let our servers grab their passphrase if we click "Yes let this server grab its passphrase" on a dashboard of ours?) that Go uses to generate a miniLock key pair (exactly like LeapChat does from the passphrase in the URL hash) -- and we give it the same passphrase every time
  3. Go uses the public key half of that key pair to encrypt each 2FA secret it generates
  4. Those 2FA secrets are stored encrypted on disk
  5. When Go needs a user's 2FA secret it (a) grabs it off disk, (b) decrypts it, and (c) uses it

Then if someone hacked the server or cloned its HD, they'd need to scrape the secret key from RAM in order to decrypt each user's 2FA secret.

Think that makes a meaningful difference, security-wise? If so, think it's worth the additional hassle/complexity?

from pursuance.

ajvb avatar ajvb commented on June 8, 2024

@elimisteve Could we get our hands on servers with an HSM?

from pursuance.

elimisteve avatar elimisteve commented on June 8, 2024

@ajvb Not sure yet. The downside there is that data we've encrypted with the HSM cannot be moved to a different server/we can't create useful backups of it that we can use elsewhere, which concerns me.

from pursuance.

Related Issues (20)

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.