码迷,mamicode.com
首页 > 其他好文 > 详细

图文并茂解释数字证书(转)

时间:2015-01-05 18:11:10      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

http://www.youdzone.com/signature.html
What is a Digital Signature?
An introduction to Digital Signatures, by David Youd

技术分享
Bob
技术分享 技术分享
(Bob‘s public key)

技术分享
(Bob‘s private key)

Bob has been given two keys. One of Bob‘s keys is called a Public Key, the other is called a Private Key.

Bob‘s Co-workers:
技术分享 技术分享 技术分享 技术分享 技术分享
Anyone can get Bob‘s Public Key, but Bob keeps his Private Key to himself

Pat Doug Susan

Bob‘s Public key is available to anyone who needs it, but he keeps his Private Key to himself. Keys are used to encrypt information. Encrypting information means "scrambling it up", so that only a person with the appropriate key can make it readable again. Either one of Bob‘s two keys can encrypt data, and the other key can decrypt that data.

Susan (shown below) can encrypt a message using Bob‘s Public Key. Bob uses his Private Key to decrypt the message. Any of Bob‘s coworkers might have access to the message Susan encrypted, but without Bob‘s Private Key, the data is worthless.

技术分享 技术分享 "Hey Bob, how about lunch at Taco Bell. I hear they have free refills!" 技术分享 HNFmsEm6Un BejhhyCGKOK JUxhiygSBCEiC 0QYIh/Hn3xgiK BcyLK1UcYiY lxx2lCFHDC/A

技术分享 技术分享 HNFmsEm6Un BejhhyCGKOK JUxhiygSBCEiC 0QYIh/Hn3xgiK BcyLK1UcYiY lxx2lCFHDC/A 技术分享 "Hey Bob, how about lunch at Taco Bell. I hear they have free refills!"

With his private key and the right software, Bob can put digital signatures on documents and other data. A digital signature is a "stamp" Bob places on the data which is unique to Bob, and is very difficult to forge. In addition, the signature assures that any changes made to the data that has been signed can not go undetected.

技术分享 技术分享 技术分享

技术分享 To sign a document, Bob‘s software will crunch down the data into just a few lines by a process called "hashing". These few lines are called a message digest. (It is not possible to change a message digest back into the original data from which it was created.)

技术分享 技术分享 技术分享

Bob‘s software then encrypts the message digest with his private key. The result is the digital signature.

技术分享 技术分享 技术分享

Finally, Bob‘s software appends the digital signature to document. All of the data that was hashed has been signed.

技术分享 技术分享 技术分享
技术分享 技术分享

Bob now passes the document on to Pat.

技术分享 First, Pat‘s software decrypts the signature (using Bob‘s public key) changing it back into a message digest. If this worked, then it proves that Bob signed the document, because only Bob has his private key. Pat‘s software then hashes the document data into a message digest. If the message digest is the same as the message digest created when the signature was decrypted, then Pat knows that the signed data has not been changed.

Plot complication...

技术分享 Doug (our disgruntled employee) wishes to deceive Pat. Doug makes sure that Pat receives a signed message and a public key that appears to belong to Bob. Unbeknownst to Pat, Doug deceitfully sent a key pair he created using Bob‘s name. Short of receiving Bob‘s public key from him in person, how can Pat be sure that Bob‘s public key is authentic?

It just so happens that Susan works at the company‘s certificate authority center. Susan can create a digital certificate for Bob simply by signing Bob‘s public key as well as some information about Bob.

Bob Info: 
    Name 
    Department 
    Cubical Number

Certificate Info: 
    Expiration Date 
    Serial Number

Bob‘s Public Key: 
    技术分享

技术分享 技术分享
技术分享
技术分享 技术分享

Now Bob‘s co-workers can check Bob‘s trusted certificate to make sure that his public key truly belongs to him. In fact, no one at Bob‘s company accepts a signature for which there does not exist a certificate generated by Susan. This gives Susan the power to revoke signatures if private keys are compromised, or no longer needed. There are even more widely accepted certificate authorities that certify Susan.

Let‘s say that Bob sends a signed document to Pat. To verify the signature on the document, Pat‘s software first uses Susan‘s (the certificate authority‘s) public key to check the signature on Bob‘s certificate. Successful de-encryption of the certificate proves that Susan created it. After the certificate is de-encrypted, Pat‘s software can check if Bob is in good standing with the certificate authority and that all of the certificate information concerning Bob‘s identity has not been altered.

Pat‘s software then takes Bob‘s public key from the certificate and uses it to check Bob‘s signature. If Bob‘s public key de-encrypts the signature successfully, then Pat is assured that the signature was created using Bob‘s private key, for Susan has certified the matching public key. And of course, if the signature is valid, then we know that Doug didn‘t try to change the signed content.

技术分享
Although these steps may sound complicated, they are all handled behind the scenes by Pat‘s user-friendly software. To verify a signature, Pat need only click on it.

图文并茂解释数字证书(转)

标签:

原文地址:http://www.cnblogs.com/fishou/p/4204116.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!