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

用公钥加密中文没法解 #3

Open
zesicus opened this issue Jun 29, 2016 · 3 comments
Open

用公钥加密中文没法解 #3

zesicus opened this issue Jun 29, 2016 · 3 comments

Comments

@zesicus
Copy link

zesicus commented Jun 29, 2016

从服务器得到的加密过的中文到我这可以解,但是用
- (NSString *) encryptWithPublicKey:(NSString*)content
加密过的中文却没法解出来,服务器那边说加密过的格式不正确,请问怎么解

@zesicus
Copy link
Author

zesicus commented Jun 29, 2016

加密过的英文服务器还是可以解的……是不是加密过程中中文的encoding有问题?我已经替换
- (NSString *) decryptWithPrivatecKey:(NSString*)content
中一行为
NSMutableString *decryptString = [[NSMutableString alloc] initWithBytes:decData length:strlen(decData) encoding:NSUTF8StringEncoding];
可以解密服务器那边传送过来的中文了,可是app端加密的中文还是没法解怎么办呢?

@HustBroventure
Copy link
Owner

我看看。

在 2016年6月29日,15:01,Sunny notifications@github.com 写道:

加密过的英文服务器还是可以解的……是不是加密过程中中文的encoding有问题?我已经替换

  • (NSString ) decryptWithPrivatecKey:(NSString)content
    中一行为
    NSMutableString *decryptString = [[NSMutableString alloc] initWithBytes:decData length:strlen(decData) encoding:NSUTF8StringEncoding];
    可以解密服务器那边传送过来的中文了,可是加密的中文还是没法解怎么办呢?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #3 (comment), or mute the thread https://github.com/notifications/unsubscribe/AM4y8zp4r3m-Mx1LEK6B8riAOfKXYDPMks5qQhhVgaJpZM4JA007.

@HYAdonisCoding
Copy link

加密过的中文却没法解出来,请问怎么解?

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

3 participants