Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在iOS9上加密图片转的data返回nil #12

Open
xiaolouxinyue opened this issue Nov 11, 2015 · 3 comments
Open

在iOS9上加密图片转的data返回nil #12

xiaolouxinyue opened this issue Nov 11, 2015 · 3 comments

Comments

@xiaolouxinyue
Copy link

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;
}

@xiaolouxinyue
Copy link
Author

swift版已经支持分段了,不知oc版何时能更新

@ideawu
Copy link
Owner

ideawu commented Nov 11, 2015

我刚刚做了改进, 已经支持分段加密/解密了.

@xiaolouxinyue
Copy link
Author

3q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants