Encrypting passwords

This is a discussion on Encrypting passwords within the C++ Programming forums, part of the General Programming Boards category; So using that method, I really shouldn't have any problems, right? I mean, besides the insecurity (I hope for something ...

  1. #16
    Registered User
    Join Date
    Oct 2006
    Posts
    118
    So using that method, I really shouldn't have any problems, right?

    I mean, besides the insecurity (I hope for something this simple to be temporary).

    Thanks again!

    FlyingIsFun1217

  2. #17
    Registered User
    Join Date
    Oct 2006
    Posts
    118
    Ok, since I've gotten that to work...

    Is there any way to do other math to the string to change its characters? Right now all it does is add and subtract 7, but would it be possible to do other math functions to it to make it just a little more secure?

    Thanks again!

    FlyingIsFun1217

  3. #18
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,488
    You will not be making it more secure with a shifting method. No matter how much math you add to it. It will always "shift" the characters on the character table by a given amount.

    Search the web for "c++ encryption" if you want to make it any more secure than that.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #19
    Registered User
    Join Date
    Apr 2006
    Posts
    2,047
    [QUOTE=FlyingIsFun1217]Ok, since I've gotten that to work...

    Is there any way to do other math to the string to change its characters? Right now all it does is add and subtract 7, but would it be possible to do other math functions to it to make it just a little more secure?

    Thanks again!

    FlyingIsFun1change it by a pattern. For example change it by the fibinachi sequence -- change the first two element by 1, the seccond by 2, the third by 3 ext.

    If the file is only used on one computer, you can use random numbers to change it. Then you store the random seed in the file. If use the same random seed and change in the opposite direction you will get your original results back. This always works on the same computer and sometimes works on the same system. This meathod is proveably breakable if the codebreaker does not discover the seed, and the numbers are truely random.

    Simmilarly, you could create your own list of random numbers that come with the program. That would make the pervious option portable across computers. This would also allow you to use sites like random.org to generate true random numbers. The problem with this aproach is that the list or random numbers needs to be very long, and therefore the file must be very large. Otherwise a user could apply every possible seed to decrypt your program.

    Back to option two, instead of storing the seed in the file, you could store it in the Windows Registry. This is a bit more complex, but it will make it very hard to decrypt your data.

    EDIT: For some reason(Mario F.'s last post) I thought you were using a bitwise shift. I changed this post to accomidate any kind of reversible change. Change can mean mean adding a number, using a bitwise rotation, XOR, and many other functions.

    As Mario F. said, applying more than one of these functions on a single number, will not make the encryption more secure, unless the function is very easy to guess.
    Last edited by King Mir; 11-11-2006 at 03:36 PM.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  5. #20
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211
    hashing is probably your best bet.

    take a look at MD5 and SHA on wikipedia:

    http://en.wikipedia.org/wiki/MD5
    http://en.wikipedia.org/wiki/SHA-1

    for examples of implementations in C++ search the forums for MD5 and SHA, I know for a fact that there are a few good examples posted here.

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

  6. #21
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,488
    I suspect the OP will get confused at any possibility beyond what King Mir alreay provided. He will probably learn more by trying his suggestions.

    I suspect even suggesting a Xor algorithm will confuse our friend. I don't want to sound pretentious. But its probably best if he takes baby steps.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  7. #22
    Registered User
    Join Date
    Apr 2006
    Posts
    2,047
    I agee there is little point in showing him xor. The only advantage of using xor in this case is that the generated text looks more alien. But that's a misleading, because it would still be equally dificult to decrypt.

    A better aproach would be to use a look up table. Kind of like what siavoshkc suggested, exept his example does more than he said it does, and is therefore not applicable.
    Last edited by King Mir; 11-11-2006 at 04:39 PM.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  8. #23
    Registered User
    Join Date
    Oct 2006
    Posts
    118
    Thanks to all for your help, I am currently looking into the problem, and since I am using wxWidgets to create the GUI, I may want to look into something with that...

    FlyingIsFun1217

  9. #24
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    Mind me asking what search term you used?
    Sorry for late answering. It was "password encryption (algorithm)" I think.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Page 2 of 2 FirstFirst 12
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, 04:27 PM
  2. Database programming and passwords
    By Squintz in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2003, 08:05 PM
  3. Encrypting and checking passwords in bigger programs
    By TerryBogard in forum C Programming
    Replies: 1
    Last Post: 11-17-2002, 06:21 AM
  4. XOR Encrypting Program Problem (C++)
    By biosx in forum C++ Programming
    Replies: 2
    Last Post: 02-26-2002, 10:28 AM
  5. Encrypting still
    By bitWise in forum C Programming
    Replies: 1
    Last Post: 10-15-2001, 07:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21