This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Encrypted password containing carraige return character not getting saved in database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Encrypted password containing carraige return character not getting saved in database" Watch "Encrypted password containing carraige return character not getting saved in database" New topic
Author

Encrypted password containing carraige return character not getting saved in database

RAGHAVA KUMAR
Greenhorn

Joined: Jul 27, 2007
Posts: 4
Hi,

While iam applying Exclusive-OR on two different strings(encryption),I am getting carraige return character in the resultant string. It is not getting saved properly in the database. Can you please suggest how to identify the carraige return character in the string and replacing with some other character so that it will be saved properly in the database.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35249
    
    7
If a String is encrypted it is no longer character data - it becomes binary data. So you can no longer store it in a String, or work on it using String's methods, or store it in a varchar field in a DB.

The easiest solution would probably be to generate an ASCII representation of the data using something like base-64. The Apache Commons Codec library has methods to encode and decode base-64.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Encrypted password containing carraige return character not getting saved in database
 
Similar Threads
Send each character to Server
char range
q on character literals?
I don't get it!
Escape Sequence \r