开发者

Decryptionproblem iPhone

开发者 https://www.devze.com 2023-01-12 23:55 出处:网络
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 decry

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

0

精彩评论

暂无评论...
验证码 换一张
取 消