- [Instructor] There's a little more terminology
that you'll need to know before we start diving in
to the details of cryptography.
Let's talk about codes, and ciphers.
Codes and ciphers are different concepts.
People often use these terms interchangeably,
but they are actually two very different things.
You need to be sure that you understand the difference
between codes and ciphers when you take the exam.
A code is a system that substitutes
one meaningful word or phrase for another.
This might be done for secrecy purposes,
or it might be done for efficiency of communications,
allowing a short message to convey a detailed meaning.
One example of a code that you've probably already heard of
is the Ten Code system, used by police,
and other organizations who communicate by radio.
They have a long list of codes,
that allow the person sending a message
to simply say two numbers,
and convey a long meaning.
For example, 10-4 means "I acknowledge your message."
While 10-9 means "Please repeat your last transmission."
This is an example of using codes
for the efficiency of communication.
You'll also see codes pop up often in spy movies.
When a secret operative calls in from the field and says,
"The blue cow jumped over the moon",
but really means that the subject
of a surveillance operation disappeared.
That's an example of using codes for secrecy.
Ciphers, on the other hand, are systems that use
mathematical algorithms to encrypt and decrypt messages.
All of the cryptographic algorithms
we talk about in this course
are examples of ciphers, not codes.
Ciphers have two different ways of processing a message.
Stream ciphers work on one character
of the message at a time.
They perform their action
on a single character, or a single bit,
and then move on to the next character or bit.
Block ciphers work on chunks of the message,
known as blocks, at the same time.
They might take 100 characters of a message, for example,
and encrypt them all at the same time.
Ciphers perform their encryption and decryption operations
using two basic building blocks.
Substitution ciphers actually change
the characters in a message.
A simple substitution cipher might, for example,
shift all of the letters in a message by two positions,
changing the A's to C's, the B's to D's, and so on.
When someone wants to decrypt the message,
they simply shift the characters back by two positions.
Transposition ciphers don't change
the characters in a message,
but instead they rearrange them.
They're basically scrambling up the message
in a way that only someone who knows the decryption key
can unscramble them.
We just talked about two very basic examples
of substitution and transposition ciphers.
You wouldn't use these today,
because they're very easy to crack,
but these two operations do form the basis
of the modern encryption algorithms
that we'll talk about later in this course.