easiest way to encode a file?

T

tiewknvc9

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?
 
O

Oliver Wong

tiewknvc9 said:
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
 
R

Roedy Green

T

tiewknvc9

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.
 
T

tiewknvc9

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.
 
O

Oliver Wong

tiewknvc9 said:
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.

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

- Oliver
 
A

Andrey Kuznetsov

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.

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

Andrey
 
T

tiewknvc9

that is an interesting question, wish I knew what you were asking...
perhaps you are missing a couple of words?
 
A

Andrey Kuznetsov

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
 
O

Oliver Wong

Andrey Kuznetsov said:
OK, from start:
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.

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
 
L

Luc The Perverse

Oliver Wong said:
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.

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.
 
T

tiewknvc9

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top