aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Marshal

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


Ping & DNS - updated with new look and Ping home screen widget
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: 39535
    
  27
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
 
Similar Threads
Help....StringTokenizer
Exception executing servlet with database connectivity
Help...StringTokenizer
How to convert ArrayList to String Array in java
Enumeration is not returning any data