Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feeding NSUnarchiver bad data can cause crash



On 3 Jun 2004, at 5:27 pm, Glenn Andreas wrote:

Why not just add your own tag to the start of the data before you encrypt it. When you decrypt it, check for the tag (to see if it decoded correctly), and then remove that tag and decode it.


On 3 Jun 2004, at 6:12 pm, Louis C. Sacha wrote:

Another possibility would be to append some sort of signature or checksum to the end of the data produced by the archiver, before you encrypt it.

Then after you decrypt the data, you could check the last bytes of the data for the signature or verify the checksum before passing the rest of the data to the unarchiver.

This is in fact what I'm now doing with newly encrypted files. My app uses the MulleCipher framework for encryption, and Nat! has very kindly provided a new pre-release version which adds (optionally) an MD 5 digest to the encrypted file. When I decrypt, I can apply a rectal thermometer to the digest and choose not to unarchive it if the temperature doesn't check out.

This solves my problem so far as newly created files are concerned, but I would still like a workaround for the NSUnarchiver no-exception issue, since my app still has to deal with files created with the old framework. Besides, it's turned out to be an interesting problem...

Thanks to all. Regards,
-Jeremy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Feeding NSUnarchiver bad data can cause crash (From: Jeremy Dronfield <email@hidden>)
 >Re: Feeding NSUnarchiver bad data can cause crash (From: Glenn Andreas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.