Results 1 to 11 of 11
Thread: Hardcoded Passwords
- 05-17-2012, 04:58 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 59
- Rep Power
- 0
Hardcoded Passwords
At the moment my app hard codes passwords in order to create, read and update a local database. I want to make this more so hard coding passwords is obviously not the way to go. The problem is that if I store the password anywhere it's then viewable by anyone, if I one way encrypt it I need to store the key somewhere and I'm back where I started. If I two way encrypt it it not much more secure because it's vulnerable to anyone who decompiles my Java app and looks at the decryption algorythm.
How do people get round this problem?
- 05-17-2012, 05:05 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,374
- Blog Entries
- 7
- Rep Power
- 17
Re: Hardcoded Passwords
What is wrong with one-way-encryption? Suppose the real password is "secret" and the encrypted version (in text form) is "SDK()^&FDS&D&SDVHM*C". It's a hard task to find a matching password ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-17-2012, 05:07 PM #3
Member
- Join Date
- Apr 2012
- Posts
- 59
- Rep Power
- 0
Re: Hardcoded Passwords
It is but like I said, if it's a one way encryption then it needs a decrypt key which then needs to be stored somewhere and I'm back where I started
- 05-17-2012, 05:38 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,374
- Blog Entries
- 7
- Rep Power
- 17
Re: Hardcoded Passwords
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-17-2012, 05:59 PM #5
Member
- Join Date
- Apr 2012
- Posts
- 59
- Rep Power
- 0
Re: Hardcoded Passwords
Ah, I see what you mean. I got my encryption terminology mixed up. :P
It's still no use though, I need the application to know the password in order to connect to the database so if I have it saved as a hash I still need to have the password in order to compare to the hash before sending it to the database. I would have thought this was a common and often solved problem :(
- 05-17-2012, 06:38 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,374
- Blog Entries
- 7
- Rep Power
- 17
Re: Hardcoded Passwords
Is a user not supposed to supply a password?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-17-2012, 09:44 PM #7
Member
- Join Date
- Apr 2012
- Posts
- 59
- Rep Power
- 0
Re: Hardcoded Passwords
The app is a monitoring app that dumps log files to a database behind the scenes at specified intervals. It's also supposed to be autonomus so it's not practical to ask for the password all the time.
- 05-17-2012, 10:08 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,374
- Blog Entries
- 7
- Rep Power
- 17
Re: Hardcoded Passwords
There's your catch 22: if nobody supplies a password manually, your application has to 'know' that password and you have to hide it somewhere. Two-way-encryption is the way to go.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-17-2012, 10:10 PM #9
Member
- Join Date
- Apr 2012
- Posts
- 59
- Rep Power
- 0
Re: Hardcoded Passwords
Really, that's the best we can do? Do secure database abstraction pattern I can take advantage of? lol
- 05-18-2012, 08:19 AM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,374
- Blog Entries
- 7
- Rep Power
- 17
Re: Hardcoded Passwords
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-18-2012, 09:33 AM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
Strong passwords with Java
By qwerty53 in forum New To JavaReplies: 5Last Post: 07-13-2011, 11:54 AM -
Masking passwords & booking movies
By suneko in forum New To JavaReplies: 19Last Post: 07-22-2010, 04:46 AM -
Tomcat Realm DES encrypted passwords
By Tokajac in forum Web FrameworksReplies: 4Last Post: 07-15-2008, 12:32 AM -
Taking passwords on the console
By eva in forum Advanced JavaReplies: 2Last Post: 12-19-2007, 09:28 AM -
Pls help with a project. About doing passwords. Thanks
By saytri in forum New To JavaReplies: 0Last Post: 12-15-2007, 08:29 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks