Re: how to encrypt a C data and write a bin file and read a bin at run time and decrypt C data
- From: Michael Mair <Michael.Mair@xxxxxxxxxxxxxxx>
- Date: Sun, 05 Feb 2006 10:12:52 +0100
sweety wrote:
Dear All,
How to encrypt a C data file and make binary file and then have to read
a bin file at run time and decrypt the file and have to read the data.
Any help to achive this pls. Would be great if any sample source code
provided.
fopen() the file, in text or binary mode, as appropriate.
If your encryption algorithm depends on context w.r.t. the
input, read in the whole file (use either fread() or getc()
and malloc()/realloc() for the buffer).
Encrypt.
fopen() the output file in "b" binary mode. Write the output
to it. fclose() input and output file.
Essentially the same applies to the decryption part.
If you provide us with your best shot at it (minus the
encryption or decryption part), we may help you further
with the standard C part of it.
If you want some sort of dummy encryption/decryption for the
code you post, use a simple one, e.g. Caesar cipher.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
.
- References:
- Prev by Date: Re: How can I cause the datetime to be the name of the output file.....
- Next by Date: Re: longjmp issue
- Previous by thread: Re: how to encrypt a C data and write a bin file and read a bin at run time and decrypt C data
- Next by thread: Re: how to encrypt a C data and write a bin file and read a bin at run time and decrypt C data
- Index(es):
Relevant Pages
|