wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 41155
    
  45
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: 41155
    
  45
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
How to convert ArrayList to String Array in java
Exception executing servlet with database connectivity
Help...StringTokenizer
Help....StringTokenizer
Enumeration is not returning any data