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. Looking for an advice about password authentication

Looking for an advice about password authentication

Scheduled Pinned Locked Moved C / C++ / MFC
questionsecurityhelp
2 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.
  • H Offline
    H Offline
    Halawlaws
    wrote on last edited by
    #1

    Hi i have build an application with dialog and buttons. Only i need to have administrator account that can modify smth in the application (not the source). So i decided to create a password verification box. The problem is what is the best way 2 do it? and how can i store the password outside the source but encrypted in a way so that noone can understand it and for the administrator to be able to change it at runtime? /\|-||\/|/\|)

    M 1 Reply Last reply
    0
    • H Halawlaws

      Hi i have build an application with dialog and buttons. Only i need to have administrator account that can modify smth in the application (not the source). So i decided to create a password verification box. The problem is what is the best way 2 do it? and how can i store the password outside the source but encrypted in a way so that noone can understand it and for the administrator to be able to change it at runtime? /\|-||\/|/\|)

      M Offline
      M Offline
      mark novak
      wrote on last edited by
      #2

      Do it Unix style using 1 way encryption or hashing. There are plenty of sites there that can offer detailed descriptions of how it works but basically it's like this. You take the password and hash it using something like MD5 or SHA-1, then you store that password in plaintext. Then when you want to authenticate your user in the program, you ask for the password, you take that password and hash it and then compare that hash with the stored hash, if they match, then it's probably the right password and you let them in. This should be pretty good, you can add "salting" or a random string to the password if you want to prevent precompiled dictionary attacks... Take a look at http://www.codeproject.com/cpp/csha1.asp [^]

      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