开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜