wood burning stoves
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


Win a copy of Building Microservices this week in the Design forum!
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
That's what URL-encoding does. Check out the java.net.URLEncoder and URLDecoder classes.
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
Why would you use a 3rd party library if a built-in JRE class can do it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java encryption of String to alphanumeric values
 
jQuery in Action, 3rd edition