C# Random Key's

Discussion in 'Software' started by mastermosley, Apr 27, 2010.

  1. mastermosley

    mastermosley Sergeant

    On the initial load of my program it randomly generates a 16 character hex key
    ex. 0123456789ABCDEF. After this key is also encrypted and saved in an .ini file. What I dont want is for someone to change a few characters in the .ini file and all of a sudden they have a different key, it is critical that this doesn't happen so I need a way to validate the key how would I go about doing this?
     
  2. longbowrocks

    longbowrocks Private E-2

    I suppose there might be a few ways:
    1. make that file a decoy, and have another hidden somewhere else from which it can check.
    2. change the privileges on the file so it is read only.
    3. encrypt the file (RSA encryption might work) so that even if someone edits it they have a low to nil chance of actually getting something that decodes to a hex.
    4. run the program forever on a server or something so the value is constantly in memory and the file can't be accessed anyway (you probably don't want to do this).
     
  3. PC-XT

    PC-XT Master Sergeant

    You could add a checksum to it, like md5, SHA-1, or another hash, which would show if it was edited.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds