Thread: What is the best way to use passwords?

  1. #1
    Registered User GreenCherry's Avatar
    Join Date
    Mar 2002
    Posts
    65

    Question What is the best way to use passwords?

    Im making a program where you can set the time, it is not meant to change or sync with anything, and look at the time. I have system set up where I have the user enter a password and they have acess to change the time or change the password. I use two files for this, one to save the time ,and one for the password. I can have the cpp files up by tomorrow and would like to knbow what is the best way to use passwords.

  2. #2
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    Well for an amateur program (ie, not professional), I would have the user set up a password the first time the program is run. Then I would encrypt it (XOR^ encryption) with a key that is hardcoded into the program, then write that password to a .dat file or whatever you want.

    Then when the user tries to run the program and types in the password, you would encrypt the password they type in and then compare it to the encrypted password in the file. If they match, then log the login and do the business.

    I hope that helps and I'm sure other people have different ways they like to do things.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. vBulletin vandals and the wisdom of randomly generated passwords
    By abachler in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-08-2008, 05:27 PM
  2. Deleting IE saved user names and passwords
    By patrick22 in forum Windows Programming
    Replies: 3
    Last Post: 03-23-2008, 04:38 PM
  3. Database programming and passwords
    By Squintz in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2003, 09:05 PM
  4. Encrypting and checking passwords in bigger programs
    By TerryBogard in forum C Programming
    Replies: 1
    Last Post: 11-17-2002, 07:21 AM
  5. Entering passwords in C++
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2001, 06:37 AM