2?) Client verifies using the public key that the signature is OK.
Here is why I am confused. Say I am the man in the middle. I can connect to the server and obtain any information the server provides me, and then forward it to the client. How can the client tell who actually presented the certificate?
Here is what I also know in general:
So how does that relate to the (static?) digital signature in the certificate?
Please help me understand that specific step (verifying signature).
161 2 2 silver badges 13 13 bronze badges asked Feb 13, 2016 at 0:24 Makketronix Makketronix 1,450 1 1 gold badge 12 12 silver badges 31 31 bronze badges>>I can connect to the server and obtain any information the server provides me, and then forward it to the client - yes, but only those who have private key can decrypt it
Commented Feb 13, 2016 at 0:27 I understand that. How does that relate to "verifying signature"? Commented Feb 13, 2016 at 0:27to sign certificate you need private key, so without original private key you can't create valid signature as I know
Commented Feb 13, 2016 at 0:30But if the signature in the certificate is static for all who connect to the server, I know what the answer will be anyway, always.
Commented Feb 13, 2016 at 0:32Signatures stored at CA to verify that "this" domain name/ip assigned to "this" crt and all stuff is correct.
Commented Feb 13, 2016 at 0:43Creation of the Certificate
In the beginning, you request a certificate from a Certificate Authority (CA) by providing a Certificate Signing Request (CSR), a request that consists of domain details and public key of the server.
The CA will issue a digital certificate by following the steps below:
Digital certificate = CSR + encrypted(hash(CSR))
Verification of the Certificate:
The server sends a certificate to the user agent (browser) while making a TLS connection.
Then the user agent (browser) looks at the certificate checks whether the certificate is from a trusted CA.
If it is from a trusted CA, then the user agent parses the certificate, where we will get the CSR and encrypted(hash(CSR)).
If hash(CSR) in step 4 == hash(CSR) in step 5, then certificate is verified.
For more details about cipher suites and the negotiation process in TLS refer to TLS handshake process.
How/Why
Our browsers have a list of public keys for trusted CA's.
Presumably, the CA's are trustworthy and have private keys that are known only to the CA.
Creating encrypted(hash(CSR)) can only be done by the CA using the private key.
So if we use the CA's public key to turn encrypted(hash(CSR)) into hash(CSR), and verify this is correct, we can prove the CA did create encrypted(hash(CSR))
6,195 12 12 gold badges 42 42 silver badges 64 64 bronze badges answered Apr 14, 2021 at 2:14 RAVI KUMAR MALIYA RAVI KUMAR MALIYA 441 4 4 silver badges 4 4 bronze badgesPlease take more care formatting your answer. I fixed the layout and syntax a bit, but I'm not saying anything about the answer being correct or not.
Commented Apr 15, 2021 at 6:02After further digging, I found out what I was missing.
The server presents the certificate file with signature. What i was missing is "Digital Signature Algorithm" or similar algorithm.
Assume P is public key, R is private.
Basically, if H is input and R is private key, we get C for output.
Because C is result of Digital signature algorithm, we can use public P and output C to obtain H.
The reason why this answers my question is: Say somebody pretends to be the server and has ability to exactly replay C. Sure the certificate will look valid, but C can not proceed any further, since further messages will be encrypted with public P.
This is what I never saw the answer for.
answered Feb 13, 2016 at 2:42 Makketronix Makketronix 1,450 1 1 gold badge 12 12 silver badges 31 31 bronze badgesI understand that we have a public key from a trusted CA that can decrypt the digital signature contained within the identity certificate from www.somewebsite.com (whom we are handshaking with). What information, if any, is contained within that digital signature that is unique to www.somewebsite.com? In other words, what's to prevent us from copying the digital signature and using it on another (fake) website''s certificate? I see mention of hash code that we get from the digital signature, but what was encrypted with that hash code that allows us to trust www.somewebsite.com?
Commented Feb 16, 2018 at 20:59Check section 3.4 here: robertheaton.com/2014/03/27/how-does-https-actually-work. "However, when the client encrypts the key that will be used for actual data encryption, it will do so using the real Microsoft’s public key from this real certificate" , assuming Microsoft is the server. Sure you can steal the certificate, but you won't be able to decrypt anything as long as the client used the public key from certificate, which corresponds to a secret private key which you did not steal
Commented Feb 22, 2018 at 18:03I was asking about the digital signature specifically. I found the answer to my question here security.stackexchange.com/a/129172 and here en.wikipedia.org/wiki/Digital_signature#How_they_work In short, a message digest is created for the entire certificate and is embedded within the digital signature. This makes the digital signature unique to the certificate. Only the CA's public key can decrypt this digital signature, that's how the validity is verified and also how the final link in the chain of trust is established.
Commented Feb 24, 2018 at 1:00If the message digest is created as a function of the certificate, exactly what are the input arguments (if you will) into this function that creates this message digest? I would imagine the inputs come from data int he certificate, no? What exactly are those inputs? This is the specific point I was still curious about. Thanks.
Commented Dec 18, 2020 at 15:14Found this old article at the bottom of the search results to be the best explanation to date:
SSL-enabled client software always requires server authentication, or cryptographic validation by a client of the server’s identity. The server sends the client a certificate to authenticate itself. The client uses the certificate to authenticate the identity the certificate claims to represent.
To authenticate the binding between a public key and the server identified by the certificate that contains the public key, an SSL-enabled client must receive a yes answer to the four questions shown in the following figure.
Figure 2–9 Authenticating a Client Certificate During SSL Handshake
An SSL-enabled client goes through the following steps to authenticate a server’s identity:
After the steps described here, the server must successfully use its private key to decrypt the pre-master secret sent by the client.