13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Digital Certificates<br />

355<br />

end, the usual way of creating a digital signature is to create a message digest for the<br />

whole message using a fast hash function <strong>and</strong> then encrypt only the brief digest using a<br />

slow public key encryption algorithm.The signature can now be sent with the message<br />

via any normal unsecure method.<br />

When a signed message is received, it can be checked.The signature is decrypted<br />

using the sender’s public key. A hash value is then generated for the message using the<br />

same method that the sender used. If the decrypted hash value matches the hash value<br />

you generated, the message is from the sender <strong>and</strong> has not been altered.<br />

Digital Certificates<br />

Being able to verify that a message has not been altered <strong>and</strong> that a series of messages all<br />

come from a particular user or machine is good. For commercial interactions, being able<br />

to tie that user or server to a real legal entity such as a person or company would be<br />

even better.<br />

A digital certificate combines a public key <strong>and</strong> an individual’s or organization’s details<br />

in a signed digital format. Given a certificate, you have the other party’s public key, in<br />

case you want to send an encrypted message, <strong>and</strong> you have that party’s details, which you<br />

know have not been altered.<br />

The problem here is that the information is only as trustworthy as the person who<br />

signed it. Anybody can generate <strong>and</strong> sign a certificate claiming to be anybody he likes.<br />

For commercial transactions, it would be useful to have a trusted third party verify the<br />

identity of participants <strong>and</strong> the details recorded in their certificates.<br />

These third parties are called certifying authorities (CAs).They issue digital certificates<br />

to individuals <strong>and</strong> companies subject to identity checks.The two best known CAs are<br />

VeriSign (http://www.verisign.com/)<strong>and</strong> Thawte (http://www.thawte.com/), but you<br />

can use a number of other authorities.VeriSign owns Thawte, <strong>and</strong> there is little practical<br />

difference between the two. Some other authorities, such as Network Solutions<br />

(http://www.networksolutions.com) <strong>and</strong> GoDaddy (http://www.godaddy.com/), are<br />

significantly cheaper.<br />

The authorities sign a certificate to verify that they have seen proof of the person’s or<br />

company’s identity. It is worth noting that the certificate is not a reference or statement<br />

of creditworthiness.The certificate does not guarantee that you are dealing with somebody<br />

reputable.What it does mean is that if you are ripped off, you have a relatively<br />

good chance of having a real physical address <strong>and</strong> somebody to sue.<br />

Certificates provide a network of trust. Assuming you choose to trust the CA, you can<br />

then choose to trust the people they choose to trust <strong>and</strong> then trust the people the certified<br />

party chooses to trust.<br />

The most common use for digital certificates is to provide an air of respectability to<br />

an e-commerce site.With a certificate issued by a well-known CA, web browsers can<br />

make SSL connections to your site without bringing up warning dialogs.<strong>Web</strong> servers<br />

that enable SSL connections are often called secure web servers.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!