Abhrajit
Abhrajit

Reputation: 107

How to get SHA-512 hashing in objective-C?

as I'm very new to this field i don't have much knowledge in this domain. I want to achieve SHA-512 secure hashing in my Application. I' using,

EVP_get_digestbyname((const char*)[digestName UTF8String]);

and passing 'SHA512' in digestname...it was working when i was passing SHA1, but will it work when I pass SHA512 as parameter?

Upvotes: 1

Views: 2532

Answers (1)

rob mayoff
rob mayoff

Reputation: 385500

If you just want a SHA-512 hash, use CC_SHA512 or the related functions. Run man CC_SHA512 in Terminal for information.

If you want a SHA-512 HMAC, use CCHmac or the related functions, with kCCHmacAlgSHA512 as the algorithm argument. Run man CCHmac in Terminal for information.

Upvotes: 3

Related Questions