java is supposed to be secure?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2004
Posts: 348
Reputation: paradox814 is an unknown quantity at this point 
Solved Threads: 4
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

java is supposed to be secure?

 
0
  #1
Jun 13th, 2005
i hear that java is supposed to be very secure and it has all these security features yadda yadda yadda, but my question is: if you can decompile the program modify its content and recompile it, then how can java be secure?!?

I am asking this because I need to write a program and have a password saved (updated via an automatic web-update every week or so), but is there any way I can make sure that this password is safe? (I am going to ignore all type of password crackers) I just want to focus on java here.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 348
Reputation: paradox814 is an unknown quantity at this point 
Solved Threads: 4
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: java is supposed to be secure?

 
0
  #2
Jun 13th, 2005
oah yeah and I know about obuscaters, but that doesn't almost nothing to protect your code, just makes it really decently hard to copy
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: java is supposed to be secure?

 
0
  #3
Jun 13th, 2005
Wouldn't you encrypt the password? How exactly does this program run? Is it an applet or a JFrame that the user has?

For the update you could have a servlet that reads the password from the xml DD. I think it's the servlet context you would have to set onn that though.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: java is supposed to be secure?

 
0
  #4
Jun 13th, 2005
what are you trying to achieve?
Is the password entered by the users and the program checks it (with the users getting a new password mailed every week)?
If so the solution is simple: save the password in the form of an MD5 hash and compare the MD5 hash of the password the user enters with the hashed password you stored.
That way the application never knows the password at all (as it will get the hash from the generator, also removing the risk of a man in the middle attack fetching the unencrypted password during transmission).

No language is completely safe from decompilation, and network attacks can catch your passwords being transmitted also independently from the language used.

You can add further safeguards in your Java environment like custom classloaders that use an encrypted table of hash codes (or more likely serial version IDs) of your classes and compare those with the ones calculated from the actual classfiles to check whether there has been tampering, classfile encryption, etc. etc. but of course nothing is ever completely safe from the dedicated cracker.

What you always (in any environment) need to ask yourself is how much effort/money is the worth of your data security and how to best spend it.
Often the conclusion will be that there's no real need to go further than a stern license and removing debugging information from the compiled code.
In a high security environment you'll often find that the best way to work is to not have the end user have access to your software (or at least the secure bits) at all.
You'll be acting like an application service provider, with your customer through some interface contacting the software which is running on your own machines at a secure location you control and getting back only the results.
That way the application (and your firewalls) can prevent anyone from calling the application who is not at a known customer site. Add password security and only people at that site with the required credentials can call the application.
And only people at your site have access to the compiled binaries, so noone can decompile anything who you don't have explicit knowledge of.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 348
Reputation: paradox814 is an unknown quantity at this point 
Solved Threads: 4
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: java is supposed to be secure?

 
0
  #5
Jun 13th, 2005
yes i would encrypt the password, but if you can view my source code, then you can view how it was encrypted, and thus decrypt it, I thought about having 2 passwords, one is the software to make sure it has been updated, the other is the users, but if a program can be decompiled and recompiled then how would i stop some malicious user from creating some methods to save the user passwords before they are sent to the server?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: java is supposed to be secure?

 
0
  #6
Jun 13th, 2005
If you use a one-way encryption algorithm like MD5 there's precious little chance of it being decrypted (as the algorithm doesn't support it).

I know someone in China is doing work towards decrypting MD5 but it's so far not a threat (at most their method will give you an idea where to look for the password, some hints towards its composition).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 5
Reputation: happyshub is an unknown quantity at this point 
Solved Threads: 0
happyshub's Avatar
happyshub happyshub is offline Offline
Newbie Poster

Re: java is supposed to be secure?

 
0
  #7
Jun 23rd, 2005
Originally Posted by paradox814
yes i would encrypt the password, but if you can view my source code, then you can view how it was encrypted, and thus decrypt it, I thought about having 2 passwords, one is the software to make sure it has been updated, the other is the users, but if a program can be decompiled and recompiled then how would i stop some malicious user from creating some methods to save the user passwords before they are sent to the server?
As far as encryption is considerd it is onlly solution and as said MD% is one way encryption algorithm and even if someone decompiles it it cannot decrypt it !!

And If you r so concerd about security during network their is combination of public private key encryption used during networks and a software cannot be secure more than that even dedicated cracker will be able to crack windows security which is having both software and hardware support you just have software security though :p
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC