CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Files

  1. #1
    Join Date
    Nov 2002
    Posts
    2

    Files

    hi there,
    my problem is that i want to save a file but i dont want it to be able to open from dos (by type or edit) or from windows (by a word program) i just want it to be opened from my program.
    if the answer is to write (ios::binary) well i tried it but nothing
    happened.

    fadi

  2. #2
    Join Date
    Aug 2002
    Location
    Hamburg / Germany
    Posts
    280

    think you are in trouble ;o)

    Hi,
    I don't think that there is a easy way to implement what you want.

    files are basically files for the filesystem of your OS. There are no special filetypes that can be used for your purpose... just files.

    So what ? why shouldn't someone try to open your files with a wrong application ?

    you know the effect if you try to open a binary (exe etc.) file with an ASCII-Editor ? yess only crappy chars that are of no use.

    so if you encrypt your files with a simple mechanism it will be very, very hard for someone to get a bit of structured information.

    Greets

    Juergen

  3. #3
    Join Date
    Nov 2002
    Posts
    2
    Thanks for your coeperation
    first of all i want to know what is the real effect of:
    (ios::binary)
    because i noticed no difference
    second :how can i encrypt the file
    thanks again
    Fadi

  4. #4
    Join Date
    Nov 2002
    Location
    San Diego, USA
    Posts
    48
    If you plan to encrypt the file, you could use a block cipher algorithm like AES to help you achieve this. Your program could have a secret key which is used to encrypt/decrypt the data.

    My website (http://www.anujseth.com/crypto/blockciphers/aes.html) has links to a few C/C++ implementations of AES.

    BUT: The file can still be opened by other programs -- only difference being that the contents would seem to be junk to them as it would be encrypted.
    Anuj Seth

    http://www.anujseth.com/

    YahooPOPs!: A Windows/Linux POP3/SMTP-to-web gateway that gives free POP3 and SMTP access to your Yahoo Mail!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured