Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to encrypt String to only printable characters ???

248 views
Skip to first unread message

Thorsten Meininger

unread,
Feb 1, 2003, 4:51:00 AM2/1/03
to
I need an encryption method to encrypt (and decrypt) a contents of a text string to
a target string which contains only printable characters (or even characters A-Z,a-z,0-9).
How do I do that ?

As far as I know the Jave Encrytion extension JCE doesn't offer such a method.
If I use e.g. Blowfish in JCE it produces a ciphertext which contains Linebreaks (<CR>).
So it is not suitable.

It is not required to be ultra secure.
Does someone know an easy way to accomplish that ?

Thank you
Thorsten

Peter Rank

unread,
Feb 1, 2003, 5:23:53 AM2/1/03
to
After using your favourit crypt algoritm use the Base64Encoder.
Peter

"Thorsten Meininger" <t_me...@hotmail.com> schrieb im Newsbeitrag
news:b1g5a3$7bt$05$1...@news.t-online.com...

Z

unread,
Feb 1, 2003, 5:40:02 AM2/1/03
to
In comp.lang.java.help Thorsten Meininger <t_me...@hotmail.com> wrote:
: I need an encryption method to encrypt (and decrypt) a contents of a text string to

: a target string which contains only printable characters (or even characters A-Z,a-z,0-9).
: How do I do that ?

Convert each byte into 2 ASCII characters representing the hex
value of the byte, from "00" to "FF."

Ben_

unread,
Feb 1, 2003, 9:36:19 AM2/1/03
to
What about Base64 encoding after you encrypted ?

"Thorsten Meininger" <t_me...@hotmail.com> wrote in message
news:b1g5a3$7bt$05$1...@news.t-online.com...

Kenny MacLeod

unread,
Feb 1, 2003, 11:15:49 AM2/1/03
to
In article <b1g5a3$7bt$05$1...@news.t-online.com>, t_me...@hotmail.com
says...

Encrypt the string using something like Blowfish, then Base64-encode the
result.

kenny

Michael Mainguy

unread,
Feb 1, 2003, 12:44:52 PM2/1/03
to
t_me...@hotmail.com (Thorsten Meininger) wrote in message news:<b1g5a3$7bt$05$1...@news.t-online.com>...


A really easy way would be to base64 encode the encrypted String. Of
course, if you just want to obfuscate the String you could just use
the base64 encoding to start with and be done with it.

0 new messages