我需要一个查询,以谷歌的服务之一。我读了这样的回答:从谷歌的见解搜索下载CSV一>点击 从这个问题进行复制和粘贴的代码是:

using (var client = new WebClient())
    {
        // TODO: put your real email and password in the request string
        var response = client.DownloadString("https://www.google.com/accounts/ClientLogin?accountType=GOOGLE&Email=youraccount@gmail.com&Passwd=secret&service=trendspro&source=test-test-v1");
        // The SID is the first line in the response
        var sid = response.Split('\n')[0];
        client.Headers.Add("Cookie", sid);
        byte[] csv = client.DownloadData("http://www.google.com/insights/search/overviewReport?q=test&cmpt=q&content=1&export=2");

        // TODO: do something with the downloaded csv file:
        Console.WriteLine(Encoding.UTF8.GetString(csv));
        File.WriteAllBytes("report.csv", csv);
    }

和我想知道是否在字符串中发送的密码是安全的还是能不能抓住?

如果这不是保护,应该怎样做呢?

有帮助吗?

解决方案

由于它使用 HTTPS (未普通HTTP)应该是大约一样安全,因为大多数别的都不能是在网络上。的所有数据,包括URL,行程上一次底层TLS连接的建立。

加密的通道

其他提示

这是那些“好消息,坏消息”的情况之一。

好消息:密码不能被窃听者被抓取(因为它是通过HTTPS发送:加密)。

坏消息:会话cookie可以通过窃听者被抓取(因为它是通过HTTP发送:未加密)。正如Firesheep已经证明,让你的谷歌的会话cookie的人可以访问是危险的,因为它可以让您的电子邮件和存储在谷歌的其他内容的攻击者访问。

如果您可以在http网址变更为https URL,这将是更安全的。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top