Objective-C-RSA
Objective-C-RSA copied to clipboard
在iOS9上加密图片转的data返回nil
demo :
NSData *oridata = UIImagePNGRepresentation([UIImage imageNamed:@"QQ20150805"]);
NSLog(@"oridata with public key: %@", oridata);
NSData *encdata = [RSA encryptData:oridata publicKey:pubkey];
NSLog(@"Enctypted with public key: %@", encdata);
result:Enctypted with public key: null
调试发现进入如下if语句里,不知为何?因为图片数据比较大? size_t outlen = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t); if(srclen > outlen - 11){ CFRelease(keyRef); return nil; }
swift版已经支持分段了,不知oc版何时能更新
我刚刚做了改进, 已经支持分段加密/解密了.
3q