470,614 Members | 1,500 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Problem appending to an encrypted file

How can this be done?

Thanks
Nov 17 '05 #1
4 1740
Jasper,

Sure, but you can't just write to the file. Most encryption methods are
based on values that were encrypted earlier in the file, so just appending
to the end would prevent decryption.

What you really need to do is decrypt the data in the file, append to
that data, then re-encrypt the file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jasper" <ja******@hotmail.com> wrote in message
news:%SOcf.26370$2k5.10459@dukeread09...
How can this be done?

Thanks

Nov 17 '05 #2
This guy did it....I cant get it working tho...
http://www.mcse.ms/archive113-2004-10-1157980.html
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eu**************@TK2MSFTNGP14.phx.gbl...
Jasper,

Sure, but you can't just write to the file. Most encryption methods
are based on values that were encrypted earlier in the file, so just
appending to the end would prevent decryption.

What you really need to do is decrypt the data in the file, append to
that data, then re-encrypt the file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jasper" <ja******@hotmail.com> wrote in message
news:%SOcf.26370$2k5.10459@dukeread09...
How can this be done?

Thanks


Nov 17 '05 #3
Do it record based. So each record gets encrypted/decrypted independently
of other records. That way, your not dependant on anything before or after
a record. Probably what I would do is length prepend each record instead of
using delimiter(s).

--
William Stacey [MVP]

"jasper" <ja******@hotmail.com> wrote in message
news:QfQcf.26379$2k5.2759@dukeread09...
This guy did it....I cant get it working tho...
http://www.mcse.ms/archive113-2004-10-1157980.html
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:eu**************@TK2MSFTNGP14.phx.gbl...
Jasper,

Sure, but you can't just write to the file. Most encryption methods
are based on values that were encrypted earlier in the file, so just
appending to the end would prevent decryption.

What you really need to do is decrypt the data in the file, append to
that data, then re-encrypt the file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jasper" <ja******@hotmail.com> wrote in message
news:%SOcf.26370$2k5.10459@dukeread09...
How can this be done?

Thanks



Nov 17 '05 #4
jasper wrote:
This guy did it....I cant get it working tho...
http://www.mcse.ms/archive113-2004-10-1157980.html


Read carefully what Valery says in this thread, he's very respected for
his knowledge about security.

The reasons for CBC and padding are to make your encryption as secure as
possible. If you decide to remove padding, and to change the cipher mode
to ECB, then you give crackers a small advantage because repeated blocks
in the cleartext may appear in the ciphertext. You have to ba;ance the
reduction in your security with the advantage you get of being able to
append blocks to the end of encrypted text.

Personally, where security is concerned, I don't think anything is worth
having to compromise your security.

Here's some more about private key cryptography:

http://www.grimes.demon.co.uk/workshops/secWSTen.htm

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm
Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by chris | last post: by
10 posts views Thread by crawlerxp | last post: by
7 posts views Thread by c duden | last post: by
4 posts views Thread by Debbie Carter | last post: by
5 posts views Thread by John | last post: by
22 posts views Thread by Wilson | last post: by
3 posts views Thread by =?Utf-8?B?TG9yZW4=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.