Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Saving Encrypted Passwords

Saving Encrypted Passwords

Scheduled Pinned Locked Moved C / C++ / MFC
securitycsscryptographyquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ExtraLean
    wrote on last edited by
    #1

    Whats the simplist way to encrypt/decrypt a user's plaintext password? I'd like to give them a "Save your password" checkbox so that they won't need to type it again. Saving it as plain text would be a (possibly minor) security flaw, and using a hash wouldn't work because I wouldn't be able to decrypt it before passing it on to the authentication module. Basically, what I'm getting at is: Are there any "standard" encryption methods for use on plain text passwords? (NOTE: The encryption doesn't have to be very strong, just something that gives the text a sufficient "jumbling up" would suffice.) Thanks! :cool: -- Edward Livingston (aka ExtraLean) -- "I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder

    R 1 Reply Last reply
    0
    • E ExtraLean

      Whats the simplist way to encrypt/decrypt a user's plaintext password? I'd like to give them a "Save your password" checkbox so that they won't need to type it again. Saving it as plain text would be a (possibly minor) security flaw, and using a hash wouldn't work because I wouldn't be able to decrypt it before passing it on to the authentication module. Basically, what I'm getting at is: Are there any "standard" encryption methods for use on plain text passwords? (NOTE: The encryption doesn't have to be very strong, just something that gives the text a sufficient "jumbling up" would suffice.) Thanks! :cool: -- Edward Livingston (aka ExtraLean) -- "I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder

      R Offline
      R Offline
      Robert A T Kaldy
      wrote on last edited by
      #2

      Use MD5 encryption. A lot of free C++ libraries provides it, for example here. Tip: you shouldn't decrypt the password :). Instead, in the authentication module, retrieve a password from user, encrypt it by MD5 and compare it with the saved (encrypted) password. Robert-Antonio "CRAY is the only computer, which runs an endless loop in just 4 hours"

      E 1 Reply Last reply
      0
      • R Robert A T Kaldy

        Use MD5 encryption. A lot of free C++ libraries provides it, for example here. Tip: you shouldn't decrypt the password :). Instead, in the authentication module, retrieve a password from user, encrypt it by MD5 and compare it with the saved (encrypted) password. Robert-Antonio "CRAY is the only computer, which runs an endless loop in just 4 hours"

        E Offline
        E Offline
        ExtraLean
        wrote on last edited by
        #3

        Robert A. T. Káldy wrote: Tip: you shouldn't decrypt the password . Instead, in the authentication module, retrieve a password from user, encrypt it by MD5 and compare it with the saved (encrypted) password. Yes, that would be the standard way to do it, but the whole point is that I don't want to retrieve a password from the user. I want them to be able to save their password so that it just logs them in after decrypting their saved password. Also, the authentication module is a third party solution, and it expects the password in plain text. Thanks for the input, any other ideas? -- Edward Livingston (aka ExtraLean) -- "I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder

        R 1 Reply Last reply
        0
        • E ExtraLean

          Robert A. T. Káldy wrote: Tip: you shouldn't decrypt the password . Instead, in the authentication module, retrieve a password from user, encrypt it by MD5 and compare it with the saved (encrypted) password. Yes, that would be the standard way to do it, but the whole point is that I don't want to retrieve a password from the user. I want them to be able to save their password so that it just logs them in after decrypting their saved password. Also, the authentication module is a third party solution, and it expects the password in plain text. Thanks for the input, any other ideas? -- Edward Livingston (aka ExtraLean) -- "I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder

          R Offline
          R Offline
          Robert A T Kaldy
          wrote on last edited by
          #4

          Hmmmm...if you want to save the passwords in a form, which can be algorithmically decrypted, it isn't more secure, that saving it in plaintext :). If you only want BFU not to read the saved passwords in Notepad, you should use ROT13. It simply rotates the letters by 13 (A->N, B->O etc.). Or use a Vigenere cipher (see here). Robert-Antonio "Science is a differerntial equation. Religion is a boundary condition."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups