Best way to encrypt a password.
Any language.

  • 6
  • 7
    Bcrypt or Argon2
  • 4
    AES256 or chacha20 with random padding and and key with the same length
  • 11
    Caesar cipher but with random shift for every character. And with chinese symbols after A-Z.
  • 37
    > Any language.

    > Go.

    You changed your mind pretty quickly there.
  • 0
    @nitwhiz so an modification of the one time pad
  • 4
    Hash? Argon2id
    Encrypt? No
  • 1
    You beat me to it.
  • 8
    We don't encrypt passwords. Except if it's a password manager
  • 0
    What makes Go a better choice of language for that?
    Oh wait :thinking:
  • 8
  • 2
    Just flip all the bits
  • 9
    reverse it, but twice.
    double the security.
  • 2
    ROT13 used by one of the biggest companies in the world over 10 years
  • 3
    set it as a variable value in a Perl script.
  • 0
    All of you who commented but didn't leave a ++ will roast in hell...
    makes me think of chicken..
    darn you!

    (Also HAR HAR "GO" dad jokes)
  • 2
    @kfalencik the fires shall be warmer then my current location 🤗🔥
  • 0
  • 1
    Read it to a baby until it mumbles something random. Store that along with the plaintext password.
  • 1
    Best encryption will vastly differentiate from a good effective one lol
    Also, as said before, passwords a generally being hashed, not encrypted
  • 0
    Pair each letter/number with a symbol(i.e. a to "$") then place the resulted string in a perl script, nobody will suspect a thing.
  • 1
    Set the password to ******** then put that as plain text in your code. No one will try it because they will assume it is redacted.
  • 1
    Depends on what you want to achieve.
    Security only?
    One time pad wins by default (but it's only useful for a local password manager).
    DB entries to check passwords inserted by users? You shouldn't save the encrypted version but only an hash.
    Sending passwords to the users? Any secure encryption, it's not more important than the rest of the users' data (e.g. their session tokens).
    Personally I would use the same protocol as the session tokens (possibly adapting it for asymmetric encryption if necessary) because it guarantees the same security instead of potentially creating a security breach (if you use two different protocols only one needs to be faulty to generate a breach).
  • 1
    @fuck2code almost right. Eventually the user has to receive the passwords you randomly generated for him.
  • 0
    @nitwhiz it's equivalent to one time pad but notice that the chinese symbols are useless. They increase the space of the output but if the attacker excludes those symbols it's the precise same brute attack as a Cesar with random offsets or a randomly generated one time pad.
  • 2
    ROT13 two times will be TWICE as secure!
  • 0
  • 0
    Nah, scrypt is more resistent to FPGAs.
  • 1
    @metamourge Fair enough but I've never found a ready to use php library and compiling it has never worked for me either so then I'd say that BCrypt is the next best thing...
Your Job Suck?
Get a Better Job
Add Comment