views:

100

answers:

5

I have N- Tier application Which consist of three parts:

1. Client (WPF)
2. WebService (Java web service) (Business logic)
3. Database (Oracle)

I store my password in md5 in oracle database but send password from from client to web service in not encrypted state just like a simple string. Which technic I have to use to secure password in network?

A: 

I think the below link will helps you

http://msdn.microsoft.com/en-us/library/ff648643.aspx

Bala
A: 

If you're worried about the requests being intercepted then you could use SSL to communicate between the client and the WS. Even if you encode the real password inside the client before sending it to the webservice, if the encoded form is somehow disclosed it could be used 'as is' to formulate a request to the webservice from any HTTP client. Alternatively you could encrypt the message content itself using an algorithm stored solely in the client so you can ensure that all WS requests come only from your client.

CyberDude
A: 

You could send password MD5 from client to web service. Even better, salted MD5 (and in DB you should keep also salted MD5). Then just compare what is received from client with what is in DB.

amorfis
How is this secure? What stops me from intercepting that MD5 (or salted MD5 hash) and sending it from my malicious application as a password?
Regent
MD5 is not a password. But you are right, there should be another protection (like SSL) too.
amorfis
+1  A: 

I would really recommend using SSL unless you want to go through caring about a lot of security concerns. Kerberos solve those pretty nicely as well but it is not that straightforward to use.

I've get some insights about secure authentication problems by reading Designing an Authentication System: a Dialogue in Four Scenes (it is about designing Kerberos, but a lot applies to all authentication systems in general).

Regent
+1 SSL is really the only viable option
Qwerky
A: 

I think SSL is your friend as suggested by others. But whatever you do, I would not send the MD5 hash over the network. Part of the point of hashing (with MD5 or else) is to avoid storing a value that can be used 'as such' to authenticate a user. If any attacker gets access to the DB, he only sees the hashed password, but would still need to use the original password - which he can't decrypt from the hash - to access the web service. If your web service, instead of asking for the original pwd and hashing it itself before comparing it with the value stored in the DB, decides to let the client do the hashing, the aforementioned attacker needs only to send the compromised hash to be authenticated.

doundarric