Thread: help hiding text

  1. #1
    mysterious mongoose
    Join Date
    Apr 2005
    Posts
    18

    help hiding text

    In just about all of my C++ programs, if you open up the program in notepad, you can see almost every string used in plaintext.
    This is a problem because i am trying to make a secure password system.
    Any output that i have shows up in notepad.
    Any strings that i have shows up in notepad
    Any strings used in a if statement or while loop shows up.

    Is there anyway that i can stop this from happening? The only way i can think of is to put each character that i dont want to show up in an array, but thats causing problems when i try to use that in a conditional statement

  2. #2
    Banned
    Join Date
    Jun 2005
    Posts
    594
    the onyl way you will make this secure is if
    you dont actually show a password in your program

    what you can do, is do something to the user password
    and if it equals something then let them in

  3. #3
    mysterious mongoose
    Join Date
    Apr 2005
    Posts
    18
    yes but as i said before, when i do that. i.e. have the program ask for a password. If you open the program up, you can see what the input is being compared to in the if statement
    i.e.
    Code:
    if (input == "thisisthepassword")
    {
    cout<<"you got the password";
    }
    if that is in the program, if you open it up in notepad, you can see the word "thisisthepassword" in plain text

  4. #4
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    he means like change it..

    like replace letter and change letters with symbols so it doesn't look like it was..

  5. #5
    *this
    Join Date
    Mar 2005
    Posts
    498
    So you essentially want to encrypt it?

    Have your program test a password to an encrypted password using some sort of encryption algorithm.

  6. #6
    mysterious mongoose
    Join Date
    Apr 2005
    Posts
    18
    good idea!
    i already have a bunch of encryption programs that i made so it shouldnt be too hard

  7. #7
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    You don't want encryption; you want hashing.

  8. #8
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    you don't want hashing - in alot of cases there are multiple things that can hash to the same value.

    like ILoveVectors and JostR said, I would save the encrypted vesion of the password somewhere, and when a user enters their password, encrypt it and test it against the saved (encrypted) password.

    I would avoid saving the password in your program though, because then you have no easy way of changing it...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    you don't want hashing - in alot of cases there are multiple things that can hash to the same value.
    Unless you're using a good cryptographic hash algorithm. But yeah, if you are going to go that far, you might use encryption instead.

    Still, what is your "secure password system" supposed to do? Just because you use strong cryptosystems doesnt mean your security is good.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    well, I was assuming this was only meant to be secured from people with direct access to his computer (family?). in that case, a simple XOR encryption should be good enough to keep them out (unless they know what they're doing)
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  11. #11
    Registered User
    Join Date
    May 2005
    Posts
    41
    Hmmm

    Im completly new to programming, so I could be wrong.
    But, couldnt you save the password in a binary file, then read the binary file, save the data red into another value, and check if the password the user red is equal to the files' value?

    You could then make another program that saves the password into the BIN file, but requires the current password to run.

    Go here to learn about C++ file I/O

    Hope it helps!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My text doesn't display
    By joeprogrammer in forum Game Programming
    Replies: 11
    Last Post: 02-23-2006, 10:01 PM
  2. Appending text to an edit control
    By dit6a9 in forum Windows Programming
    Replies: 3
    Last Post: 08-13-2004, 09:52 PM
  3. Text positioning and Text scrolling
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 08-13-2004, 12:35 AM
  4. Scrolling The Text
    By GaPe in forum C Programming
    Replies: 3
    Last Post: 07-14-2002, 04:33 PM
  5. Replies: 1
    Last Post: 07-13-2002, 05:45 PM