Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I've read a lot of articles.

The client uses the information sent by the server to authenticate the server. If the server cannot be authenticated, the user is warned of the problem that an encrypted and authenticated connection cannot be established. If the server can be successfully authenticated, the client proceeds.

However, I haven't found an answer to my following question.

When a client's browser goes to a bank website, and gets the bank certificate, what does the operating system do in order to approve that this is the bank?

I think it is as follows, but please correct me if I'm wrong:

  1. The bank sends its certificate and its public key to the client. This certificate also has a hashed info which was encrypted with the server's certificate private key.

  2. The client searches to see if it is a valid CA + decrypts the hashed info with the CA public key.

  3. The client encrypts the server's PK and also gets a hashed value to see if both hashes are the same.

Is this right?

share|improve this question

migrated from stackoverflow.com Feb 24 '12 at 1:52

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 4 down vote accepted

Firstly, a reminder, in public key cryptography:

  • The private key is used for signing and deciphering/decrypting.
  • The public key is used for verifying signatures and enciphering/encrypting.

See the glossary of the TLS specification:

public key cryptography: A class of cryptographic techniques employing two-key ciphers. Messages encrypted with the public key can only be decrypted with the associated private key. Conversely, messages signed with the private key can be verified with the public key.

In your question:

1) the bank sends it's certificate and its public key to the client.

this certificate has also a hashed info which was encrypted with servers certificate private key

This doesn't make sense (you don't encrypt with a private key).

The server certificate is signed using a private key (and yes, it's a hash of the certificate content that is effectively signed). However, it's not done using the server's private key (unless the certificate is self-signed). This is done using the private keys of the certificate issuer (the CA): the one named in the certificate Issuer DN.

Your browser or OS comes with a pre-defined set of CA certificates. These CAs are those able to issue certificate, that is sign their content with their private keys (and put their own Subject DN as the Issuer DN of the certificate they issue). When verifying a given (a priori unknown) certificate, you look for one of your known CA certificates whose Subject DN matches the Issuer DN of that server certificate. If the public key of that CA certificate allows you to verify the server certificate (i.e. if the CA did indeed sign the content of that certificate), it's a match.

(It's also possible to build a chain when there are intermediate CA certificates: the server can send a chain, which you may have to link to your known CA certificates.)

There is no encryption involved in all this: it's all digital signature.

share|improve this answer
    
You could argue that there is never any encryption: it's just padding and modular exponentiation. But the same operation is performed when you encrypt and when you sign, so whether you call it "digital signature" or "encrypting the digest", you're actually doing the same thing. –  Omri Barel Feb 23 '12 at 23:52
1  
@OmriBarel, you can't remove the purpose of these operations (signing or encrypting) from the picture if you want to understand where they fit in the security mechanism. It's all about the definition of the word encrypting: it means "hiding something" not "padding and performing exponentiation". In addition, what you're saying works for RSA, but I'm not sure whether DSA can even be used for encryption at all. –  Bruno Feb 24 '12 at 0:08
    
If the public key of that CA certificate allows you to verify the server certificate can you please explain how does he do it ? ......ok so my computer has the CA's public key - now i can verify the signed signature.. but how does he do that ? he whould check if xxx==yyy....how does he get xxx and yyy ?how the verification works internally ? –  Royi Namir Feb 24 '12 at 10:55
    
@RoyiNamir probably this sslshopper.com/article-most-common-openssl-commands.html will help you. Scroll down to "Checking Using OpenSSL" to see how to check a certificate's content. –  tftd Feb 25 '12 at 4:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.