| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
The setup I'm using is this. An attributed string is archived, and the archived data is encrypted using a Blowfish symmetric cipher, producing a second data object which is saved to disk. Later, the encrypted data is decrypted. If the key used for decryption is the wrong one, the data will decrypt, but will be "bad" data. If this is passed to an NSUnarchiver for unarchiving as an attributed string, the unarchiver forces it to unarchive, resulting an error:_______________________________________________
*** +[NSUnarchiver unarchiveObjectWithData:]: extra data discarded
and, sometimes, a SIGNAL 11 crash:
*** malloc_zone_malloc[414]: argument too large: 4294967286
If exactly the same encrypted data is decrypted with the correct key, producing "good" data, it unarchives just fine, never crashes, and all is cool.
The magic numbers you mention would be extremely useful if I knew how to access them. Perhaps it's possible to parse the decrypted data to see if the magic number is there? Or is it only present when the archive is written to file? In my case, it's the encrypted archive, not the archive itself, which is saved to disk.
Regards,
-Jeremy
| References: | |
| >Re: Feeding NSUnarchiver bad data can cause crash (From: Jeremy Dronfield <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.