15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

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

Chapter 5: Encryption Algorithms<br />

In This Chapter<br />

Encryption basics<br />

Symmetric and asymmetric encryption<br />

Cracking encryption with attacks<br />

Encryption involves scrambling in<strong>for</strong>mation, or plaintext, and converting<br />

it into another <strong>for</strong>mat — ciphertext — essentially turning ordered data<br />

into seemingly random gibberish. By encrypting in<strong>for</strong>mation, you can keep<br />

data in<strong>for</strong>mation out of the hands of other people, which can be useful <strong>for</strong><br />

sending coded messages <strong>for</strong> military use, sending credit card in<strong>for</strong>mation<br />

over the Internet to online shopping Web sites, or just hiding your personal<br />

documents from the prying eyes of family members, co-workers, or strangers.<br />

The simplest <strong>for</strong>m of encryption is substitution cipher, which basically<br />

replaces each letter with a specific symbol, such as another letter. A substitution<br />

cipher simply replaces one letter with another letter from the alphabet<br />

a fixed distance away, such as replacing the letter A with the letter Z, the<br />

letter B with the letter A, the letter C with the letter B, and so on.<br />

In this case, each letter gets replaced by the previous letter in the alphabet,<br />

like this:<br />

I AM HOT<br />

Replacing the letter I with the letter H, the letter A with the letter Z, and so<br />

on creates the following ciphertext:<br />

H ZL GNS<br />

This in<strong>for</strong>mation may be scrambled, but after someone discovers that each<br />

letter in the ciphertext actually represents the next letter in the alphabet,<br />

this simple substitution cipher can be cracked easily. When an encryption<br />

method can be broken easily, it’s weak encryption. If an encryption method<br />

can’t be broken easily, it’s strong encryption.<br />

The key to deciphering the substitution cipher is recognizing both the method<br />

it’s using (replacing one letter with another) and the specific way it implements<br />

that method (replacing each letter with the previous letter in the<br />

alphabet). A slightly more-complicated substitution cipher might replace

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

Saved successfully!

Ooh no, something went wrong!