muzipiao/GMObjC

SM4加密后结果为null

xiaosheng-W opened this issue · 2 comments

NSString *sm4Key = @"8888888888888888";
NSString *plaintext = @"{"idserial":"123456"}";
NSString *ecbCipertext = [GMSm4Utils ecbEncryptText:plaintext key:sm4Key];
NSLog(@"打印SM4加密:%@", ecbCipertext);

image

sm4Key 应为 32 字节长度16进制格式字符串,"8888888888888888" 非16进制格式,长度为16字节

多谢回复