internal void DecryptFile() { JsonService jsonService = new JsonService(); var path = Environment.CurrentDirectory + "\\ansewer.json"; using (StreamReader reader = File.OpenText(path)) { string dados = reader.ReadToEnd(); var FileData = jsonService.Deserializar <IoResponseModel>(dados); FileData.decifrado = DecryptCesar(FileData.cifrado); FileData.resumo_criptografico = Sha1(FileData.decifrado); SaveFile(FileData); } }
public IoResponseModel GetCipher(string token) { IoResponseModel oRes = new IoResponseModel(); var url = BASEURL + $"generate-data?token={token}"; var req = WebRequest.CreateHttp(url); req.Method = WebRequestMethods.Http.Get; req.UserAgent = "Chipher DEMO"; var jsonService = new JsonService(); using (var resp = req.GetResponse()) { var dados = resp.GetResponseStream(); StreamReader reader = new StreamReader(dados); var json = reader.ReadToEnd(); oRes = jsonService.Deserializar <IoResponseModel>(json); } return(oRes); }