private void EncryptResponseIntoFile(string filePath, Response response) { var jsonResponse = JsonConvert.SerializeObject(response); var contentDecrypted = Encoding.UTF8.GetBytes(jsonResponse); var xKey = Encoding.ASCII.GetBytes(_p); var contentEncrypted = Rc4.Encrypt(xKey, contentDecrypted); var hexadecimal = BiteArrayToHex.Convert(contentEncrypted); var fileContent = Zipper.Compress(hexadecimal); File.WriteAllText(filePath, fileContent); }