Thread: Getpas function

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    5

    Getpas function

    Hi i have to do a VERY basic encryption on a password that is read from a text file. It is read into an array and i encrypted it with an XOR however i now need to compare this encrypted password to one entered with the getpass function and stored and accessible by a pointer to it. So i need to work out a way of getting to this password that is entered so i can apply the same encryption to it so i can compare the two encrypted passwords with strcmp.

    Any ideas?

    Thanks Mark

  2. #2
    Registered User
    Join Date
    Apr 2006
    Posts
    5
    I have had an idea if i could covert the pointer with the password in into a array then i could encrypt that. BUT i have no idea to to covert the pointer into an array!

  3. #3
    Registered User 00Sven's Avatar
    Join Date
    Feb 2006
    Posts
    127
    Why not just use an array in the first place? Make an array, "password", and then scan their password into it. Then just use your encryption function on that array and strcmp it with the one that you get from the file.
    ~Sven
    Windows XP Home Edition - Dev-C++ 4.9.9.2
    Quote Originally Posted by "The C Programming Language" by Brian W. Kernignhan and Dennis M. Ritchie
    int fflush(FILE *stream)
    On an output stream, fflush causes any buffered but unwritten data to be written; On an input stream, the effect is undefined. It returns EOF for a write error, and zero otherwise. fflush(NULL) flushes all output streams.
    board.theprogrammingsite.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 06:44 PM