Decryptionproblem iPhone
i have some problem to decrypted a file, which was encrypted using a C# AES256 implementation with an IV (in vector) as an 16bit byte-array and 32bit byte-array开发者_Python百科 for the key. For decryption i used Apple's CommonCryptor CCCrypt, but my key is an NSString. So how can i convert the NSString to an 32bit byte-array/unsigned char?
You can get the UTF8 string or c-string in a couple of ways:
NSString *myString = @"Hello";
const unsigned char *string = (const unsigned char *) [myString UTF8String];
const unsigned char *otherString = (const unsigned char *) [myString cStringUsingEncoding: NSASCIIStringEncoding])
Check out the NSString Reference
精彩评论