1. how to implement password protection for an application?

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?

Dan

new topic     » topic index » view message » categorize

2. Re: how to implement password protection for an application?

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.

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: how to implement password protection for an application?

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.

-Greg

Thanks Greg, I'll give it a look, and thanks for providing the link!

Dan

new topic     » goto parent     » topic index » view message » categorize

4. Re: how to implement password protection for an application?

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: how to implement password protection for an application?

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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu