In this lesson, we introduce the basic term and concept of cryptography,

which shows the mathematic formula and representation

of cryptosystem and present you a encryption model or process,

and two basic encryption method.

Cryptography is a Greek word for, "Secret writing".

There are two confusing terms in cryptography.

One is called cipher,

the other is called code.

Cipher is character by character and bit-to-bit kind of transformations.

Sometime we call it algorithm without regarding

to the linguistic structure of the messages.

The code on the other hand replacing one word

with another word or symbol with special meaning.

For example, in the World War II,

the military hired Navajo coder to encrypt the messages using their native tongue.

For example, here, "chay-da-gahi-nail-tsaidi" actually

referred to tortoise killer and which is tank destroyer.

And you can imagine how Japanese cryptanalysts had a hard time

decode and figure out what is being said by these Navajo code talker.

Often the code mechanism is using codeword instead but

here these Navajo code talker doesn't require any codebook,

it's their native tongue.

The art of devising cipher is called cryptography.

The art of breaking it is called cryptanalysis.

Cryptography and cryptanalysis together is known as cryptology.

A cryptosystem can be represented mathematically by 5-tuple, E, D, M, K, C.

Where M is the messages refer to a set of plaintexts.

K, or key, is the set of keys used in encryption and decryption.

C is a set of ciphertexts which is the result of the plaintext after encryption.

E is a set of enciphered functions produce the ciphertext, C.

D is a set of deciphering function

taking the ciphertext C and the

key K as the input and then produce original plaintext M.

One of the famous cipher is Caesar cipher.

It was so simple and so creative at

the time and actually it was not figured out by his enemy.

Let's examine it using the above mathematic notation.

The M is all sequence of Roman letters.

K is an integer between 0 and 25.

They say all the upper case of the alphabet.

Including zero and- including the range 0 and 25.

E is a set of all encryption function E stop k where little k belong to big K.

Given a plaintext character M belong to a sequence of M,

the E sub K of M will produce the value of m+k module 26.

It is another Roman letter.

D is a set of all D sub k where little k belong to the big K which is key again.

Given a ciphertext character C which belong to a sequence of

C ciphertext the D sub k of C is equal

to 26+c-k and then operate on module 26.

For example, k=3, letter A will be encrypted by the encrypted function

as letter D. Letter E will be decrypted by that decrypting function as letter B.

You can verify it yourself.

For k=2, a word,

"HELLO" will be encrypted as JGNNQ.

I will let you figure out what K value is for the encrypted,"HELLO" to be KHOOR.

Here we show an encryption model,

all the processing diagram using symmetric-key cipher.

Symmetric-key cipher is a cipher that uses the same key

both in encryption and sending side encryption side and the decryption side.

You are using the same key to encrypt plaintext and decrypt the ciphertext received.

The sender text, the plaintext faded into this encryption box with the key.

The output of the box is a ciphertext which is then sent along over the insecure channel.

We assume that the ciphertext can be intercepted,

copy suddenly sometime order and send it along to by the intruder to the receiver.

The receiver receives a ciphertext will fit into

the description box with

the same key which is pre-agreed upon or sends through a separate channel.

The output hopefully is the same plaintext.

The design of symmetric-key cipher is to make it

difficult for the intruder to figure out the plaintext.

It should be rather fast to compute by the encryption box and decryption box.

Hopefully, the receiver can detect

any alterations of the message during the decryption process.

There are two basic encryption methods or building box.

Substitution cipher and transposition cipher.

In substitution cipher, each letter or group of

letters are replaced by another letters or another group of letter.

It will preserve the order of the plaintext symbols but disguise them individually.

For example, the Caesar cipher is a simple substitution cipher.

But they are more complicated one such as

mono alphabetic substitution cipher where

each letter is made to another unique letter in the alphabet.

So there are two 26 factorial combination.

Close to 4x10 to the 26th possible key.

So it's very protected.

How one really to decipher here is three famous words of

Julius Caesar's and it's

a mono substitution cipher but how come it's only four letter words.

They're all four letter word.

Another basic class of cipher is called transposition cipher.

Here we reorder the letter but do not disguising them.

We made them, okay, or mapping them.

The rail fence cipher is a simple version of this.

For example, with "HELLOWORLD" we will line them up in two rows roll from left to right,

up and down first and fill the column first and then left to right.

Up to the line up we then spell out the word in a row column first.

For example, "HLOOL" followed by "ELWRD" will be sent out.

It become a weird word not recognizable.