On 15 Feb 2009, at 11:06 pm, Graham Cox wrote:

I have some code using the openssl library to perform some public- key decryption. I'm finding that the calendar system in use (Gregorian vs. Hebrew say, as set in System Preferences) affects the outcome of performing a SHA1 hash on some arbitrary data. Is this to be expected? It seems weird to me - it makes it difficult to compare hashes on machines not set to the same calendar system that the hash was created on.


OK, never mind...

Unless you use Aquatic Prime. The way AQP computes the hash of a given dictionary is to concatenate the dictionary object's -description strings, then hash that. If the dictionary contains a NSDate object, the description will be sensitive to the calendar system set in System Prefs, hence the hash will come out differently. I'm not using AQP but I did borrow its hashing method. I've now changed it, and the problem is solved for me.

But if you are using AQP, this is another one of its many flaws.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to