Cryptography

Basics

05

Cryptography means secret writing. It is the art and science of sending secret messages and it has been used by generals and governments and everyday people practically since the invention of written language.

As we will see in this lesson, modern cryptographic techniques are essential to guaranteeing the security of our transactions on the Internet. Cryptography plays a role whenever you make an online purchase at Amazon or provide your password to Google. If we couldn't rely on those transactions being secure: i.e., being encrypted using some cryptographic algorithm, we really wouldn't have the Internet as we know it today.

This lesson focuses on some of the classical ciphers that followed the Caesar cipher, which Julius Caesar used in 34 B.C. Like the Caesar cipher, the other ciphers we will study in this lesson will be symmetric ciphers, which means that the same key is used both for encrypting and decrypting messages. As we will also see, all ciphers consist of two parts, the key and their algorithm. And it is the key, not the algorithm, that allows the cipher to create secret messages. In fact, in modern cryptography the algorithms are all based on open standards that are created by teams of experts, discussed openly and adopted and maintained by standards organizations.

So, let's take a look at some of the classical ciphers and some of the basic principles of cryptography. There are several hands-on activities in this lesson, where you'll have a chance to practice encrypting and decrypting messages and analyzing ciphers.

Technical Terminology

Introduction to Cryptography and the Caesar Cipher

Cryptography means secret writing. It is the art and science of sending secret messages and it has been used by generals and governments and everyday people practically since the invention of written language. Modern cryptographic techniques are essential to guaranteeing the security of our transactions on the Internet. 

Cryptography plays a role whenever you make an online purchase at Amazon or provide your password to Google. Whenever you see the https protocol in your browser, you can rest assured that your communications are secure because they are being encrypted with strong, unbreakable encryption. If we couldn't rely on those transactions being secure we really wouldn't have the Internet as we know it today. 

Next we will look at several different versions of cryptography, including the strong encryption that protects our Internet transactions. But let's begin here with a simple cipher, the Caesar cipher, so named because it was used by Julius Caesar in 34 B.C. The following video will explain the basics of the Caesar cipher. 

Cryptography Basics - Video

Cryptography Basics - Slides

06.05 Cryptography Basics A

Activity 1: Caesar Cipher

Simple Substitution - Video

Simple Substitution - Slides

06.05 Cryptography Basics B

Activity 2: Simple Substitution Cipher

(open in new window)

Cracking Simple Substitution - Slides

Cracking Simple Substitution - Slides

06.05 Cryptography Basics C

Activity 3: Frequency Analysis

One of the following messages below was encrypted using a substitution cipher and the other with a transposition cipher

↓ Scroll down ↓ for two encrypted messages. Can you identify which is which? Paste the messages below into the frequency analyzer tool and observe their frequency histograms?

open in new window



(lots of space for the output


Message 1:

nybfx ymjgj xytky nrjxn ybfxy mjbtw xytky nrjx nybfx ymjfl jtkbn xitrn ybfxy mjflj 

tkktt qnxms jxxn ybfxy mjjut hmtkg jqnjk nybfx ymjju thmtk nshwj izqny dnyb fxymj 

xjfxt stkqn lmyny bfxym jxjfx tstki fwpsj xxny bfxym jxuwn sltkm tujny bfxym jbnsy 

jwtki jxufn wbjm fijaj wdymn slgjk twjzx bjmfi stymn slgjk twjzx bjbj wjfqq ltnsl inwjh 

yytmj fajsb jbjwj fqqlt nslin wjhy ymjty mjwbf dnsxm twyym jujwn tibfx xtkfw qnpjy 

mjuwj xjsy ujwnt iymfy xtrjt knyxs tnxnj xyfzy mtwny njxns xnxyj itsny xgjn slwjh jnaji 

ktwlt titwk twjan qnsym jxzuj wqfyn ajijl wjjt khtru fwnxt stsqd

Message 2:

ttbti swhot istta osmwh gflhs tsecf liaho ondia henit ahena nwtpnf ewtie fpree rhbou 

hnhbo uerli deovw rlode oeasr hrdsa itrei ttein ittie ntote gceoo rrits etegc psoya hsfmt 

sesfm iahew dtseo oiewh pheet tecir uytss sohts ssoks isero oisen oeawa vtnee watne 

ewagn rtenw egnit htwih tpiao reeet eoaoo sieuo tiiei ieidg dfvih pliee omrol setet wtese 

iotao siaoo fwphe lwtof wtofs tsipt wtsid egfed gfweo gtaea grehn oeofl psrdm fssri 

sdbnv foone avefi nweoi arowg fiaef nsteb isefc tieag ieare ahgha hrdhy irsoi rseli ceeli 

ctryt ewskh nphst oahss nsrer oelur droan

Vigenere Cipher - Video

Vigenere Cipher - Slides

06.05 Cryptography Basics D

Activity 4: Vigenere Cipher

(open in new window)


3. Frequency analysis: Use the Frequency Analyzer tool (above) to count the letter frequencies in the following text, which is the same text that was encrypted in an earlier exercise. In this case it was encrypted using Vigenere cipher. What differences do you observe from the histograms you used in the previous exercise?

sabjt zdffj tgexj dekhx xrslg ixfrk ssgki edwj kwsrx ivayd sgnik csnzt ozwuy esfip wfgnp 

jjhfd wtzt ozwuy ewosd yoxai mzexh xxrsl gifgo ugsgz nuqie llasc jkws rxivs wzwpe 

oxhki kilve tkhwr ibjof njbik fdwt ztozw uyeko vjegg elpge asabj tzdaj etwqs gueko ejiw 

wgeev vwqcu yifff fwojd ytnez zhoft zhrhs exnvf lsod afies kphfi ffhji eusxp vandr xvwwq 

ibcly nmoxd aqidk tzds uyejv ezznk gsskt zdtfi igcab jsgee scicd xivpj dwfet hdvj fdlge 

ujoed sgztk msjji wrxbl tznvj kiwrm ojiks iefna swcv iffvf teaui ewojf spuoj essvv akmok 

hwryq vrdzx jmevd ksve gegpd psqmt fngmp z

Perfect Secrecy - Video

Perfect Secrecy - Slides

06.05 Cryptography Basics E

Still Curious?