开发者

Objective c - CCCryptorStatus without CCOptions

开发者 https://www.devze.com 2023-04-09 10:41 出处:网络
I would like to know, how can I define a CCCryptorStatus withou开发者_Go百科t using CCOptions. The documentation said, if I don\'t set the kCCOptionECBMode, the default is CBC mode, which is good for

I would like to know, how can I define a CCCryptorStatus withou开发者_Go百科t using CCOptions. The documentation said, if I don't set the kCCOptionECBMode, the default is CBC mode, which is good for me. But I don't need for kCCOptionPKCS7Padding too, so how can I set this?

I try:

CCCryptorStatus cryptStatus = CCCrypt(opMode,                   /* Defines the basic operation: kCCEncrypt or kCCDecrypt */
                                      kCCAlgorithmAES128,       /* Defines the encryption algorithm */
                                      0,...

but this is the correct way? Because if I want to use this method, I get an NSData object with full of 0, but with the correct size. So I don't think this value is good... Thanks for any reply, madik


When I encountered this problem, I had to use kCCOptionPKCS7Padding. As far as I can see it's the only solution.

Please note, that using of the padding increases the security.

0

精彩评论

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

关注公众号