Encrypting entire file

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
 
M

Mythran

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
 
K

Ken

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
 

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

Top