Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

easiest way to encode a file?

Thread view: 
tiewknvc9 - 04 May 2006 23:08 GMT
Im trying to encode the data that I save in my applications saved
files, basically I just want to find something simpley implemented and
dependable on the conversions.

is there anything in the Java api that Im missing that may be able to
help me with this?  Or will I need to develop something customized?
Oliver Wong - 04 May 2006 23:20 GMT
> Im trying to encode the data that I save in my applications saved
> files, basically I just want to find something simpley implemented and
> dependable on the conversions.
>
> is there anything in the Java api that Im missing that may be able to
> help me with this?  Or will I need to develop something customized?

   I think we're using different terminology. I'm guessing you have some
data in the form of objects floating around in memory, and you'd like to
save this data to files. Simplest way to do that is to use Java
serialization (see
http://java.sun.com/docs/books/tutorial/essential/io/serialization.html).
One step above that is to use an XML persistence library
(http://www.castor.org/); the next step is persisting to DB
(http://www.hibernate.org/), and then after that you'd be looking at
designing your own custom file format.

   - Oliver
rounner@yahoo.com - 05 May 2006 00:05 GMT
Or he might mean cryptographically encode data?
Roedy Green - 05 May 2006 03:07 GMT
>Im trying to encode the data that I save in my applications saved
>files, basically I just want to find something simpley implemented and
>dependable on the conversions.

Do you mean?

1. encode in a national character set,  see
http://mindprod.com/jgloss/encoding.html

2. encrypt so snoops can't see what you sent. see
http://mindprod.com/jgloss/jce.htm

3. armour so that binary data can be sent as printable text.
See http://mindprod.com/jgloss/armouring.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrey Kuznetsov - 05 May 2006 08:09 GMT
> 2. encrypt so snoops can't see what you sent. see
> http://mindprod.com/jgloss/jce.htm

http://mindprod.com/jgloss/jce.html

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

tiewknvc9 - 05 May 2006 22:13 GMT
um... I mean I have already saved a file (as plain text).  However I
would like to dissallow the user the ability to open the file as text
and read every single one of my saved items.

So I think that this means that I have a regular text file that I want
to hide any readable data from a person that would open it in notepad
and try to read it.
tiewknvc9 - 05 May 2006 22:14 GMT
um... I mean I have already saved a file (as plain text).  However I
would like to dissallow the user the ability to open the file as text
and read every single one of my saved items.

So I think that this means that I have a regular text file that I want
to hide any readable data from a person that would open it in notepad
and try to read it.
Oliver Wong - 05 May 2006 22:24 GMT
> um... I mean I have already saved a file (as plain text).  However I
> would like to dissallow the user the ability to open the file as text
[quoted text clipped - 3 lines]
> to hide any readable data from a person that would open it in notepad
> and try to read it.

   You want cryptography then. That's the
http://mindprod.com/jgloss/jce.html link.

   - Oliver
Roedy Green - 05 May 2006 23:15 GMT
>    You want cryptography then. That's the
>http://mindprod.com/jgloss/jce.html link.

other related links of interest:
http://mindprod.com/jgloss/encryption.html
http://mindprod.com/jgloss/ssl.html
http://mindprod.com/jgloss/certificate.html
http://mindprod.com/jgloss/digitalsignatures.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrey Kuznetsov - 05 May 2006 23:27 GMT
> um... I mean I have already saved a file (as plain text).  However I
> would like to dissallow the user the ability to open the file as text
[quoted text clipped - 3 lines]
> to hide any readable data from a person that would open it in notepad
> and try to read it.

one interesting question is - how do you want to hide this person to delete
or change this data?

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

tiewknvc9 - 08 May 2006 21:13 GMT
that is an interesting question, wish I knew what you were asking...
perhaps you are missing a couple of words?
Andrey Kuznetsov - 09 May 2006 13:59 GMT
> that is an interesting question, wish I knew what you were asking...
> perhaps you are missing a couple of words?

OK, from start:
> I have a regular text file that I want
> to hide any readable data from a person that would open it in notepad
> and try to read it.
I assume that this data could be important.
So you don't want to lose it.
So, since you can't hide user from opening data in notepad,
he can change or delete this data.

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

Oliver Wong - 09 May 2006 15:36 GMT
>> that is an interesting question, wish I knew what you were asking...
>> perhaps you are missing a couple of words?
[quoted text clipped - 7 lines]
> So, since you can't hide user from opening data in notepad,
> he can change or delete this data.

   By "hide", you probably mean "prevent": You can't prevent the user from
opening the data file in notepad.

   Depending on the OS being used, it may be possible to modify the access
rights so that only the application (and perhaps the system administrator)
can access the file. But then again, if you could implement this access at
the OS level, there wouldn't be much use in encrypting the file in the first
place.

   - Oliver
Luc The Perverse - 10 May 2006 00:27 GMT
>>> that is an interesting question, wish I knew what you were asking...
>>> perhaps you are missing a couple of words?
[quoted text clipped - 16 lines]
> the OS level, there wouldn't be much use in encrypting the file in the
> first place.

It seemed pretty clear cut to me.

He doesn't want the file readable but realizes that someone could reverse
engineer his code to find out how to get the solution.

I'd say use an encoding - but since the cryptographic functionality is
already built into Java, just assign and store a key and then use it with an
encryption algorithm like AES.  (AES is fast.)  Since the key will be
available, using a more secure algorithm won't really matter, but AES is
good all around.

--
LTP

:)
tiewknvc9 - 11 May 2006 15:41 GMT
I used cryptology, its not secure for some user that really wants to
break it, but for my purposes I think it will do!

Thanks, I plan on using the handshake idea before "billing" the user.
Andrey Kuznetsov - 13 May 2006 10:09 GMT
>    By "hide", you probably mean "prevent.
yup

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.