从过去的一周开始,我试图解密在java服务器中加密的数据,我的值如下
解密值 - > admin
密码 key - > 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
。它始终显示为null。有人请帮忙