-
Notifications
You must be signed in to change notification settings - Fork 87
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
GMSm2Utils 加密后返回空字符串 #90
Comments
oldPwd 可以是任意字符串,返回为空,原因可能如下:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
环境:GMObjC 3.3.0 Xcode15.2 iOS17.2模拟器
问题:
返回sm2Pwd为nil。
步骤:1.将用户输入密码进行 MD5|
方法如下:
{
const char *cStr = [pwd UTF8String];
unsigned char digest[CC_MD5_DIGEST_LENGTH];
CGFloat pwdLength = pwd.length;
CC_MD5( cStr, pwdLength, digest );
NSMutableString *result = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
[result appendFormat:@"%02x", digest[i]];
return result;
}
2.将 MD5 的字符串进行 GMSm2Utils encryptText 加密。使用后台返回的公钥。
也使用过encryptHex方法,也是同样返回 nil
The text was updated successfully, but these errors were encountered: