easiest way to encode a file?

Discussion in 'Java' started by tiewknvc9, May 4, 2006.

  1. tiewknvc9

    tiewknvc9 Guest

    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?
     
    tiewknvc9, May 4, 2006
    #1
    1. Advertising

  2. tiewknvc9

    Oliver Wong Guest

    "tiewknvc9" <> wrote in message
    news:...
    > 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
     
    Oliver Wong, May 4, 2006
    #2
    1. Advertising

  3. tiewknvc9

    Guest

    Or he might mean cryptographically encode data?
     
    , May 5, 2006
    #3
  4. tiewknvc9

    Roedy Green Guest

    On 4 May 2006 15:08:04 -0700, "tiewknvc9" <> wrote,
    quoted or indirectly quoted someone who 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.


    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
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, May 5, 2006
    #4
  5. Andrey Kuznetsov, May 5, 2006
    #5
  6. tiewknvc9

    tiewknvc9 Guest

    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, May 5, 2006
    #6
  7. tiewknvc9

    tiewknvc9 Guest

    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, May 5, 2006
    #7
  8. tiewknvc9

    Oliver Wong Guest

    "tiewknvc9" <> wrote in message
    news:...
    > 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
     
    Oliver Wong, May 5, 2006
    #8
  9. tiewknvc9

    Roedy Green Guest

    On Fri, 05 May 2006 21:24:46 GMT, "Oliver Wong" <>
    wrote, quoted or indirectly quoted someone who said :

    > 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
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, May 5, 2006
    #9
  10. > 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

    --
    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
     
    Andrey Kuznetsov, May 5, 2006
    #10
  11. tiewknvc9

    tiewknvc9 Guest

    that is an interesting question, wish I knew what you were asking...
    perhaps you are missing a couple of words?
     
    tiewknvc9, May 8, 2006
    #11
  12. > 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

    --
    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
     
    Andrey Kuznetsov, May 9, 2006
    #12
  13. tiewknvc9

    Oliver Wong Guest

    "Andrey Kuznetsov" <> wrote in message
    news:e3q3mo$ses$...
    >> 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.


    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
     
    Oliver Wong, May 9, 2006
    #13
  14. "Oliver Wong" <> wrote in message
    news:mN18g.11191$fV1.4486@edtnps82...
    >
    > "Andrey Kuznetsov" <> wrote in message
    > news:e3q3mo$ses$...
    >>> 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.

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

    --
    LTP

    :)
     
    Luc The Perverse, May 10, 2006
    #14
  15. tiewknvc9

    tiewknvc9 Guest

    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.
     
    tiewknvc9, May 11, 2006
    #15
  16. Andrey Kuznetsov, May 13, 2006
    #16
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tom
    Replies:
    4
    Views:
    14,282
    jpowers5882
    Oct 24, 2008
  2. DanB
    Replies:
    8
    Views:
    544
  3. Raymond Schanks
    Replies:
    0
    Views:
    356
    Raymond Schanks
    Jul 15, 2010
  4. Ryan Ternier

    Easiest way giving an XML file to a control

    Ryan Ternier, Nov 15, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    147
    Scott Mitchell [MVP]
    Nov 15, 2004
  5. Sam Roberts
    Replies:
    0
    Views:
    105
    Sam Roberts
    Apr 3, 2005
Loading...

Share This Page