Encrypting entire file

  • Thread starter Thread starter KC Eric
  • Start date Start date
K

KC Eric

Hi everyone,

How can one encrypt an entire file? What I mean is not simply encrypting
the content of the file, but also the file's property(e.g. file creation
date, file's name, access right, etc), so the input is a file, say
abc.txt, after encryption and then decryption, the user can get the
whole abc.txt file instead of just the content of the file.

Thanks a lot!

KC Eric
 
KC Eric said:
Hi everyone,

How can one encrypt an entire file? What I mean is not simply encrypting
the content of the file, but also the file's property(e.g. file creation
date, file's name, access right, etc), so the input is a file, say
abc.txt, after encryption and then decryption, the user can get the
whole abc.txt file instead of just the content of the file.

Thanks a lot!

KC Eric

Sounds like you want some sort of file compression utility (Zip, Tar-Ball,
et cetera) and use their encryption techniques :)
HTH,
Mythran
 
KC said:
Hi everyone,

How can one encrypt an entire file? What I mean is not simply encrypting
the content of the file, but also the file's property(e.g. file creation
date, file's name, access right, etc), so the input is a file, say
abc.txt, after encryption and then decryption, the user can get the
whole abc.txt file instead of just the content of the file.

Thanks a lot!

KC Eric
KC,
I like the ZIP suggestions others wrote about, but if you can't or
don't want to use ZIP, you could grab the input file's information from
the FileInfo class, encrypt that, place it at the beginning of your
encrypted file, then encrypt the contents of the file, placing that
behind the encrypted file info.

On decrypt, read the encrypted file info first, create the output file
(decrypted) with that info, then decrypt the file's contents into the
file.

I've done it in Delphi before but not c#, even though it looks to be
just as easy.

Ken - KC7RAD
www.aninetworks.com
 
Back
Top