I used jersey web service in java language .
I have this code :
@GET
@Path("/getList/{login}/{password}/{email}")
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public String getList(@PathParam("login") String login,@PathParam("password") String password,@PathParam("email") String email){
if(login!=null && !"".equals(login)&& password!=null && !"".equals(password))
{
if(login.equals("admin")&& password.equals("12345"))
{
List list= findDataList(login,password,email);
if(list!=null && list.size()>0)
{
JSONArray arrayObj=JSONArray.fromObject(list);
return arrayObj.toString();
}
else
{
return "No Data ";
}
}
else
{
return "access denied ";
}
}
else
{
return "access denied ";
}
}
and I used this url to test the web service :
http://localhost:8080/projectTest/service/getList/admin/1235545/test@yahoo.com
I have a login and password that is fixed in the server side ("admin" ,"12345" ) and will be compared with the parameters which will be sent in the web service url
my goal is to know how to secure the sending of the password parameter .
I want that the password will be encrypt using md5 and then decrypt this password in getList method .
I think that the best way is to use the same key
to encrypt and decrypt the password in the client and server side.