从过去一周开始,我试图解密在 java 服务器中加密的数据,我的值如下
解密值-->管理员
密码-->2020a7db17ca8071de72ef439405b570
加密数据--f118404f2b7d98a744d2fa24c0d21167
我的代码是
NSString* cipherText = @"f118404f2b7d98a744d2fa24c0d21167";
NSLog(@"CipherText = %@",cipherText);
NSString* expectedText = @"admin";
NSLog(@"expexted text = %@",expectedText);
Cipher* cipher = [[Cipher alloc] initWithKey:@"2020a7db17ca8071de72ef439405b570"];
NSLog(@"cipher = %@",cipher);
NSData* cipherTextData = [NSData dataWithBase64EncodedString:cipherText];
NSLog(@"ciphertextdata= %@",cipherTextData);
NSData* plainTextData = [cipher decrypt:cipherTextData];
NSLog(@"plaintextdata= %@",plainTextData);
NSString* plainText = [[NSString alloc] initWithData:plainTextData encoding:NSUTF8StringEncoding];
NSLog(@"plaintext= %@",plainText);
但我无法获得价值cipherTextData
和plainTextData
。它总是显示为空。任何人请帮助