Javascript AES encryption doesn't match iOS AES encryption
问题 I am encrypting an NSString in iOS like this which encodes and decodes fine: NSString *stringtoEncrypt = @"This string is to be encrypted"; NSString *key = @"12345678901234567890123456789012"; // Encode NSData *plain = [stringtoEncrypt dataUsingEncoding:NSUTF8StringEncoding]; NSData *cipher = [plain AES256EncryptWithKey:key]; NSString *cipherBase64 = [cipher base64EncodedString]; NSLog(@"ciphered base64: %@", cipherBase64); // Decode NSData *decipheredData = [cipherBase64 base64DecodedData];