コード例 #1
0
ファイル: Controller.cs プロジェクト: ittech25/LOLBITS
        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);
        }