473,382 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Need java class for encrypting to ascii printable chars

Jim
Hi,

Does anyone know of an available java class that will encrypt to
cipher text consisting of only printable ascii characters? One of the
things I need it for is to encrypt strings that will then be used as
filenames.

TIA, Jim
Jul 17 '05 #1
2 5340
nos

"Jim" <ji******@hotmail.com> wrote in message
news:94**************************@posting.google.c om...
Hi,

Does anyone know of an available java class that will encrypt to
cipher text consisting of only printable ascii characters? One of the
things I need it for is to encrypt strings that will then be used as
filenames.

TIA, Jim

maybe you can use this
it converts binary to base64 which consists
of only printable characters

// Convert a byte array to base64 string
byte[] buf = new byte[]{0x12, 0x23};
String s = new sun.misc.BASE64Encoder().encode(buf);
Jul 17 '05 #2
Jim
Thanks for the tip. I've gone ahead and converted one written in vb
over to java. Seems to work pretty well so far. I'll post it
somewhere when I get a chance.

- Jim

"nos" <no*@nospam.com> wrote in message news:<icDMb.36004$xy6.89009@attbi_s02>...
"Jim" <ji******@hotmail.com> wrote in message
news:94**************************@posting.google.c om...
Hi,

Does anyone know of an available java class that will encrypt to
cipher text consisting of only printable ascii characters? One of the
things I need it for is to encrypt strings that will then be used as
filenames.

TIA, Jim

maybe you can use this
it converts binary to base64 which consists
of only printable characters

// Convert a byte array to base64 string
byte[] buf = new byte[]{0x12, 0x23};
String s = new sun.misc.BASE64Encoder().encode(buf);

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
22
by: Sunner Sun | last post by:
Hi, all Since the OS look both ASCII and binary file as a sequence of bytes, is there any way to determine the file type except to judge the extension? Thank you!
31
by: Claude Yih | last post by:
Hi, everyone. I got a question. How can I identify whether a file is a binary file or an ascii text file? For instance, I wrote a piece of code and saved as "Test.c". I knew it was an ascii text...
7
by: Joris De Groote | last post by:
Hi, I have a 1 dimensional table byte with a number af characters in ASCII code. How do I convert those ASCII codes to real letters? Thanks
3
by: AHanso | last post by:
Hey I am new to C# (My background is in Java), I am writing a C# application (that uses the Compact Framework) that communicates to a Java server. To login the server is expecting the password...
3
by: Diwa | last post by:
In TC++PL 3edn, in section 21.2.2, Stroustrup notes that put( ) and write( ) simply write chars. Therefore, << for outputting chars need not be a member What does he mean here ? Also,...
8
by: manmit.walia | last post by:
Hello Everyone, Long time ago, I posted a small problem I had about converting a VB6 program to C#. Well with the help with everyone I got it converted. But I overlooked something and don't...
9
by: =?Utf-8?B?UGhhbmlkaGFy?= | last post by:
Hi, I'm developing a Winform application in C#( .net 2.0). I've a dialog box where user can input text and that text would be sent across to other machine using sockets. When the user enters...
14
by: jt | last post by:
hello everyone.., i'm using ubuntu 8.04 OS. I'm not able to output the non-printable ascii chatacters. for eg. printf("%c",1); // nothing is outputted..... is there any way to output these...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.