Re: how to implement password protection for an application?

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...
ghaberek said...
Dan_M said...

If I want to password protect an application, so it can't run unless a password is entered, and I want data file used by application to be encrypted, how do I go about asking user for password, and protecting the password from hacking?

If all you want is password protection, I suggest using an MD5 hash. Just store the hash of the password in a plain text file. Then whenever the user enters the password, hash that and compare it to the stored hash. If the hash matches, then it is the correct password. Encourage your users to use upper and lower case letters, numbers, and special characters to help keep the hash from getting cracked by a brute-force attack.

Is the password protection to be used for insuring your software is not used by unlicensed users? If so, you'll need to add a unique identifier to the MD5 hash (such as the PC's primary hard drive serial number) otherwise it can be easily shared among many PCs.

Thanks, good observation, but no, it's just to keep the app private for the user, not to keep unlicensed user from using it. And that's also why I'll look at encrypting the data it uses.

Dan

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu