关于数字证书的一些令人困惑的事情

发布于 2024-10-04 05:08:24 字数 567 浏览 6 评论 0原文

数字证书是证明特定用户拥有某个公钥的数字文档。因此,如果您信任签署证书 C 的 CA,那么您就可以信任该特定公钥/私钥对由证书 C 所有者拥有。

a) 假设客户端 A 想要与位于 url www.some_domain.com 的服务器 B 建立连接。当与B建立连接时,A可以从另一端接收属于所有者的X.509证书C和公钥证书C

但是客户端如何知道C的所有者实际上是服务器B,而不是劫持(如果这是正确的术语)连接并发送自己的证书的其他实体和 A 的公钥?

我能想到的让客户端知道 C 的所有者是否真的是 B 的唯一方法是 C 的主题 字段是否也指定了其域该证书有效或者它指定了该证书所属的组织(但只有当客户端知道 www.some_domain.com 属于哪个组织时才有帮助)?!

谢谢

A digital certificate is a digital document that certifies that a certain public key is owned by a particular user. Thus if you trust the CA that signed the certificate C, then you can trust that specific public/private key pair is owned by the owner of certificate C.

a) Assume client A wants to establish a connection with server B located at url www.some_domain.com. When establishing a connection with B, A may receive from the other end a X.509 certificate C and a public key, belonging to the owner of certificate C.

But how can client know that owner of C is really a server B and not some other entity that hijacked ( if that is the correct term ) the connection and sent its own certificate and public key to A?

Only way I can think of for client to know whether owner of C is really B, is if C's Subject field also specifies the domain for which this certificate is valid or if it specifies the organization to which this certificate belongs ( but that only helps if client knows to which organization www.some_domain.com belongs )?!

thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

天涯离梦残月幽梦 2024-10-11 05:08:24

证书所能做的就是确保 A 和 C 之间的通信被加密,以便 C(或安装了证书的任何设备)是唯一能够解密它的人。

它绝对没有代表 C 的所有者。一些证书颁发机构会在颁发证书之前尝试确定给定实体就是他们所说的实体。然而,坦率地说,所有这些都可能被欺骗,并且大多数网站无论如何都不会为这种级别的研究付费(称为扩展验证)。

现在,如果某个骗子从服务器 C 窃取了证书并设置了自己的服务器(具有相同的完全限定域名),那么他们就可以冒充。然而,这需要一个额外的步骤来毒害 DNS 解析,以便对 www.some_domain.com 的请求发送到黑客的服务器而不是原始服务器。通常,破解原始服务器并安装您自己的数据捕获软件会更容易。

附带说明一下,有巨大 安全 DNS 解析问题

另请注意,最近 stuxnet 蠕虫使用被盗的代码签名证书来绕过某些 Windows 安装保护。

All a certificate can do is ensure that the communications between A and C are encrypted such that C (or whatever has the certificate installed) is the only one able to decrypt it.

It makes absolutely no representation with regards to who C is owned by. Some Certificate Authorities will try and establish that a given entity is who they say they are prior to disbursing a certificate. However, quite frankly, all of that can be duped and most sites don't bother paying for that level of research anyway (called Extended Validation).

Now, if some crook has stolen the certificate from server C and set up their own server (with the same fully qualified domain name), then yes they can impersonate away. However, this would require an additional step of poisoning DNS resolution so that requests to www.some_domain.com go to the hacker's server and not the original. It's usually much easier just to crack the original server and install your own data capture software.

As a side note there are huge security issues with DNS resolution.

Another note, recently the stuxnet worm used a stolen code signing certificate to get past some of the windows installation protections.

为你鎻心 2024-10-11 05:08:24

因为“C”是由系统上已有的 CA 证书颁发机构签名的。这就是为什么控制 CA 的政府可以破坏该计划的原因。

如果您在浏览器中查看证书,则可以看到是谁签署的。例如,gmail 是由 Thawte 签名的,而 Thawte 是由 Verisign 签名的。 CN 字段标记为 www.google.com,因此它仅对该域有效。

也许你正在谈论中间的人:
http://en.wikipedia.org/wiki/Man-in-the-middle_attack

只有当攻击者能够模仿每个端点以使另一个端点满意时,中间人攻击才能成功——这是一种对相互身份验证的攻击。大多数加密协议都包含某种形式的端点身份验证,专门用于防止 MITM 攻击。例如,SSL 使用相互信任的证书颁发机构对服务器进行身份验证。

因此,在您的情况下,只有一侧会被愚弄。请查看下面的步骤 2:

https://ssl.trustwave.com/support /support-how-ssl-works.php

  • 步骤 1:客户通过 SSL 端口(通常为 443)连接到 xyz.com。此连接用 https 而不是 http 表示。
  • 第 2 步:xyz.com 将其公钥发送回客户。一旦客户收到它,他/她的浏览器就会决定是否可以继续。

    • xyz.com 公钥不得过期
    • xyz.com 公钥必须仅适用于 xyz.com
    • 客户端必须在其浏览器证书存储中安装 Trustwave 的公钥。 99.9% 的现代浏览器(1998 年以上)都包含 Trustwave 根证书。如果客户拥有 Trustwave 可信公钥,那么他们就可以相信自己确实在与 XYZ, Inc. 进行通信。
  • 第 3 步:如果客户决定信任该证书,那么客户将被发送到 xyz.com 他的/她的公钥。
    -第 4 步:接下来,xyz.com 将创建一个唯一的哈希值,并使用客户的公钥和 xyz.com 的私钥对其进行加密,然后将其发送回客户端。

  • 第 5 步:客户的浏览器将解密哈希值。此过程表明 xyz.com 发送了哈希值,并且只有客户能够读取它。
  • 第 6 步:客户和网站现在可以安全地交换信息。

Because 'C' is signed by a CA certificate authority that is already on your system. That is why the scheme can be broken by governments that control the CA's.

If you look at a certificate in your browser then you can see who signed it. For instance gmail is signed by Thawte which is signed by Verisign. The CN field is marked www.google.com so it will only be valid for that domain.

Maybe you are talking about man in the middle:
http://en.wikipedia.org/wiki/Man-in-the-middle_attack

A man-in-the-middle attack can succeed only when the attacker can impersonate each endpoint to the satisfaction of the other—it is an attack on mutual authentication. Most cryptographic protocols include some form of endpoint authentication specifically to prevent MITM attacks. For example, SSL authenticates the server using a mutually trusted certification authority.

So in your scenario only one side would be fooled. Check out step 2 below:

https://ssl.trustwave.com/support/support-how-ssl-works.php

  • Step 1: A customer makes a connection to xyz.com on an SSL port, typically 443. This connection is denoted with https instead of http.
  • Step 2: xyz.com sends back its public key to the customer. Once customer receives it, his/her browser decides if it is alright to proceed.

    • The xyz.com public key must NOT be expired
    • The xyz.com public key must be for xyz.com only
    • The client must have the public key for Trustwave installed in their browser certificate store. 99.9% of all modern browsers (1998+) include the Trustwave root certificate. If the customer has Trustwave trusted public key, then they can trust that they are really communicating with XYZ, Inc.
  • Step 3: If the customer decides to trust the certificate, then the customer will be sent to xyz.com his/her public key.
    -Step 4: xyz.com will next create a unique hash and encrypt it using both the customer's public key and xyz.com's private key, and send this back to the client.

  • Step 5: Customer's browser will decrypt the hash. This process shows that the xyz.com sent the hash and only the customer is able to read it.
  • Step 6: Customer and website can now securely exchange information.
三生路 2024-10-11 05:08:24

A 通常配置有一组受信任的 CA,这些 CA 将 C 的公钥映射到受信任的实体,在本例中为 B。您在第一段中没有回答自己的问题,还是我遗漏了什么?

A is typically configured with a set of trusted CAs, which map C's public key to trusted entities, in this case B. Did you not answer your own question in the first paragraph, or am I missing something?

香草可樂 2024-10-11 05:08:24

所以客户端A需要知道证书C是否是真实的。谁的任务是验证这一点?
答:A的浏览器。
它将如何验证?
答:浏览器检查谁签署了证书。
谁签署了证书?
答:一个名为 AweCerts.Inc 的 CA(证书颁发机构)
浏览器是否知道这个CA。浏览器信任CA吗?
答:是的。如果浏览器不信任,则 A 无法继续进行。浏览器不仅信任 AweCerts,还信任她/他的朋友(即整个链条)。
浏览器如何知道该证书是由 AweCerts.Inc 签署的?
答:浏览器与 AweCerts 达成协议。 Microsoft 在 IE 的情况中就是这样做的。
如果浏览器能够使用 AweCerts 公钥解锁消息(外壳),则可以确定它是“使用 AweCerts 私钥加密”或由 Awecerts 签名的。

我们通常用公钥加密,用私钥解密。但反过来也是可能的,这实际上就是我们所说的数字签名。您可以查看我的博客,了解有关证书和消息传递的更多有趣信息。

这里有一个有趣的博客http: //the-blueclouds.blogspot.nl/2011/11/public-key-private-key-hashing-blah.html

So the client A needs to know if certificate C is genuine. Whose task is to verify this?
Ans: A's browser.
How will it verify?
Ans: Browser checks who signed the certificate.
Who signed the certificate?
Ans: A C.A(Certification Authority) named AweCerts.Inc
Does the browser know this CA. And does the broswer trust CA?
Ans: Yes. If the broswer does not trust then A cannot proceed further. And not only does the broswer trust AweCerts but her/his friends as well (the whole chain that is).
How does the browser know this certificate was signed by AweCerts.Inc?
Ans: Browser had an agreement with AweCerts. Microsoft does this in IE's case.
If the browser is able to unlock the message(outer covering) with AweCerts public key then it is sure that it was 'encrypted with AweCerts private key' or signed by Awecerts.

We usually encrypt with public keys and have it decrypted with private keys. But the other way around is possible as well and that is infact what we call Digital Signature. And you can check my blog for more interesting info on certificates and messaging.

There is an interesting blog here http://the-blueclouds.blogspot.nl/2011/11/public-key-private-key-hashing-blah.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文