<commit_before># Chapter 3: Cryptography

[Prev: Chapter 2 - Sending Email](./chapter02.md) | [Next: Chapter 4 - Web Scraping](./chapter04.md)

## Summary:

These days everyone carries gigabytes of data on them at all times. Thus, we
face a very important task--keeping that data out of the wrong hands! That's
where the fun of encryption comes in.

You may have seen some examples of encryption before, and perhaps thought it
would be just as hard to write an encryption program as it is to crack the
cipher behind it. But fear not, for nothing is so challenging with Python--seriously,
this chapter will make you look like a genius (but of course you are one...).

So what we'll go through in this chapter is first some basic study of modern
encryption (without the nitty gritty details, which we'll leave for cryptographers).  
Then we'll use a third-party package for Python, known as *PyCrypto*, to write
a very basic encryption/decryption program to use from the command-line.

---

## Content:

---

## Wrap Up:

[Prev: Chapter 2 - Sending Email](./chapter02.md) | [Next: Chapter 4 - Web Scraping](./chapter04.md)<commit_msg>Started content for Ch03 - d0<commit_after># Chapter 3: Cryptography

[Prev: Chapter 2 - Sending Email](./chapter02.md) | [Next: Chapter 4 - Web Scraping](./chapter04.md)

## Summary:

These days everyone carries gigabytes--even terabytes--of data on them at all times. Thus, we
face a very important task--keeping that data locked down tight and out of the wrong hands! That's
where the fun of cryptography comes in.

You may have seen some examples of encryption before, and perhaps thought it
would be just as hard to write an encryption program as it is to crack the
cipher behind it. But fear not, for nothing is so challenging with Python--seriously,
this chapter will make you look like a genius (but of course you are one...).

So what we'll go through in this chapter is first some basic study of modern
encryption (without the nitty gritty details, which we'll leave for cryptographers).  
Then we'll use a third-party package for Python, known as *PyCrypto*, to write
a very basic encryption/decryption program to use from the command-line.

---

## History:

Before moving into the meat of this chapter, I'd like to give a brief history
lecture regarding the origins of cryptography. If you find this boring, or already
know it all, feel free to skip to the [good stuff](## Content).

## Content
First, let's cover some basic concepts of cryptography. Cryptography is defined as
"the art of writing or solving codes." Quite a generic definition, but that just shows
how broad the topic truly is. In most instances of cryptography there are two
primary components: *plaintext* and *ciphertext*. The plaintext is the message,
or data, in which you wish to keep secret, yet it is just...plain; the message is
just sitting there waiting for people to read. The ciphertext is the *encrypted*
version of the plaintext; this is how data is kept secure.

---

## Wrap Up:

[Prev: Chapter 2 - Sending Email](./chapter02.md) | [Next: Chapter 4 - Web Scraping](./chapter04.md)
{'fraction_non_alphanumeric': 0.0736571244773239, 'fraction_numerical': 0.009327758121582503, 'mean_word_length': 4.040518638573744, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1408901', 'n_tokens_mistral': 870, 'n_tokens_neox': 819, 'n_words': 475}