iPhone/OS X LION: How to retrieve the decoded data from the CC_SHA256 encrypted data?

前端 未结 2 1792
失恋的感觉
失恋的感觉 2021-01-29 10:11

I am encoding NSString input using the following code (CC_SHA256). Could someone help me retrieving in decoded format using the same logic?

    -(NSString*) enco         


        
2条回答
  •  滥情空心
    2021-01-29 10:36

    As the others have noted, SHA-1 and the SHA-2 variants are by design one-way hashes. If you can reverse them, the hashes are broken. The hashes are designed to check data integrity, not to provide data encryption.

    If you want encryption/decryption as opposed to hashing, you want to use one of CommonCrypto's CCCryptor routines. See:

    Any cocoa source code for AES encryption decryption?

提交回复
热议问题