File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Java encryption of String to alphanumeric values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Java encryption of String to alphanumeric values" Watch "Java encryption of String to alphanumeric values" New topic
Author

Java encryption of String to alphanumeric values

Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

Hi Ranchers,

How do I encrypt a String which is URL compliant. All my trials gives encrypted values with characters like "+" and "\". I could not get the exact values through get parameter values. So when I tried to decrypt I do not get the expected results.


Any sample code or suggestion would be greatly appreciated.

Ananth Chellathurai [Walk on software]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
That's what URL-encoding does. Check out the java.net.URLEncoder and URLDecoder classes.


Ping & DNS - my free Android networking tools app
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

Thanks ulf,

org.apache.commons.httpclient.util.URIUtil also can fulfill the same requirements.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
Why would you use a 3rd party library if a built-in JRE class can do it?
 
Consider Paul's rocket mass heater.
 
subject: Java encryption of String to alphanumeric values