You are on page 1of 36

Cryptography Fundamentals

Basic Network Security


ITWELEC6
Objectives:

At the end of the period, the students should


be able to:

• Know the basic terminologies involved with


cryptography
• Understand cryptography concepts and the
importance of keys in order to hide and retrieve
the original information
• Understand plaintext, ciphertext, and the
entities related to cryptography
Cryptography
G7JDZL L539CZ AA9CZ1
ZPQ12G 93L12B LP7FFH
18ABHU UJ14A9 334FYO
K71TYP CS3314 566HHX
SAPRW1 SP563S 3F8Y0K
PVF129 A7V8TT ADL10M
N031M1 LAE3FB 1L598X
RX0FYT LM2HU5 GT610A
I5581Z QH1UNB 9JB70W

Cryptography Fundamentals
Cryptography
• Is the science of hiding information. The practice
of it is thought to be nearly as old as the written
word.
• Cryptography comes from the Greek words:
• “kryptos” = meaning hidden and
• “graphein” = meaning to write
• Translating to “hidden writing”

Cryptography Fundamentals
bla-bla

ciphertext
msg
decoder (ciphertext in
encoder - plaintext out)
(plaintext in - bla-bla
cmb-cmb
ciphertext out)

eavesdropper
(should understand
nothing about the msg)
Terminologies
• Plaintext – The original message

• Ciphertext – The encoded message

• Cipher – Algorithm for transforming plain text to


cipher text

• Key – Info used in cipher known only to


sender/receiver
Cryptography Fundamentals
Terminologies
• Encipher (encrypt) – Conversion of plaintext to
ciphertext

• Decipher (decrypt) – Conversion of ciphertext


to plaintext

Cryptography Fundamentals
Terminologies

Plaintext Encryption Ciphertext

Ciphertext Decryption Plaintext


Plaintext

Cryptography Fundamentals
Ciphers

Original Encrypted
Cipher
Information Information

Cryptography Fundamentals
Steganography
• Is an alternative cipher process that hides
information by enclosing it in another file such as
a graphic, movie, or sound file

Cryptography Fundamentals
Steganography
• Steganographic techniques include:
– Hiding information within images.
– Invisibly altering the structure of a digital image.

Vessel Image Steganographic


Image

Secret Data

Cryptography Fundamentals
Keys
• An encryption key is a specific piece of
information that is used in conjunction with
an algorithm to perform encryption and
decryption

• Without the correct key, the receiver cannot


decrypt the ciphertext even if the algorithm is
known

Cryptography Fundamentals
Keys

Original Cipher Encrypted


Information Information

= Two
Letters
Following

Cryptography Fundamentals
Hashing

Cryptography Fundamentals
Hashing
• Is a one-way encryption that transforms
cleartext into ciphertext that is not intended
to be decrypted.

• The result of the hashing process is called a


hash

Cryptography Fundamentals
Hashing (uses)
• Hashing is used in a number of password
authentication schemes.
• A hash value can be embedded in an
electronic message to support data integrity
• A hash of a file can be used to verify the
integrity of that file after transfer

Cryptography Fundamentals
Hashing Algorithms
• MD5 (Message Digest 5) – produces 128-bit
message digest
• SHA (Secure Hash Algorithm) – modeled after
MD5, stronger than the former, produces 160-
bit hash

Cryptography Fundamentals – Hashing Algorithms


Symmetric Encryption
• Is a two-way encryption scheme in which
encryption and decryption are both
performed with the same key.

Encrypts Decrypts
Data Data

Same Key on Both Sides

Cryptography Fundamentals
Asymmetric Encryption
• Is using public and private keys
• Public key - is given to anyone as the message
is to be delivered through the internet or any
means of transportation

• Private key – is kept secret by one party


during two-way encryption because the
private key is never shared, its security is
relatively maintained
Cryptography Fundamentals
Asymmetric Encryption

Public Key Private Key


Encrypts Decrypts

Cryptography Fundamentals
Types of Ciphers
• Caesar Cipher
• Atbash Cipher
• Baconian Cipher
• Polybius Square

Cryptography Fundamentals
Caesar Cipher
• One of the earliest known and simplest
ciphers
• Is named after Julius Caesar who allegedly
used it to protect messages of military
significance

• For this cipher, the KEY(k) is the number of


characters to shift the cipher alphabet

Cryptography Fundamentals – Types of Ciphers


Caesar Cipher (cont.)
• Translate all characters to numbers whereas:
‘a’ = 0, ‘b’ = 1, …., ‘z’ = 25.
• Represent the Caesar cipher encryption
function E(x) where x is the character we are
encrypting as:

• E(x) = (x + k) mod 26

Cryptography Fundamentals – Types of Ciphers


Caesar Cipher (cont.)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6

• Example: k= 1
• Plaintext:
defend the east wall of the castle

• Ciphertext:
efgfoe uif fbtu xbmm pg uif dbtumf
Cryptography Fundamentals – Types of Ciphers
Caesar Cipher (cont.)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6

• Example: k= 7
• Plaintext:
Black clover

• Ciphertext:
Ishjr jsvcly
Cryptography Fundamentals – Types of Ciphers
Atbash Cipher
• Is an ancient encryption system created in the
Middle East.

• Is a simple substitution cipher that relies on


transposing all the letters in the alphabet such
as resulting it in backwards

Cryptography Fundamentals – Types of Ciphers


Atbash Cipher (cont.)

• Example:
• Plaintext: money
• Ciphertext: nlmvb

Cryptography Fundamentals – Types of Ciphers


Baconian Cipher
• To encode a message, each letter of the
plaintext is replaced by a group of five of the
letters ‘A’ or ‘B’. This replacement is done
according to the alphabet of the Baconian
cipher shown below

Cryptography Fundamentals – Types of Ciphers


Baconian Cipher (cont.)

Plaintext: Insertion

ABAAA ABBAA BAAAB AABAA BAAAA BAABA


Ciphertext: ABAAA ABBAB ABBAA
INSERTION

Cryptography Fundamentals – Types of Ciphers


Polybius Square
• Is a table that allows someone to translate
letters into numbers.
• To give a small level of encryption, this table
can be randomized and shared with the
recipient.

• In order to fit the 26 letters of the alphabet,


into the 25 spots created by the table, the
letters “I” and “J” are usually combined.
Cryptography Fundamentals – Types of Ciphers
Polybius Square (cont.)

• Plain: insertion (Column-Row approach)


• Cipher:423334512444424333(INSERTION)
Cryptography Fundamentals – Types of Ciphers
Time for a short quiz! :D

Get a ½ crosswise sheet of paper

Cryptography Fundamentals – Types of Ciphers


1. Using CAESAR CIPHER, decrypt the following
message where k = 7:

RLLWPUN AOL SLNHJF VM OVWL HUK ZLYCPJL

2. Using ATBASH, decrypt the following message:

PVIMVO RH GSV XLIV LU LKVIZGRMT HBHGVNH


Cryptography Fundamentals
3. Using POLYBIUS SQUARE,
decrypt the following message:
11 44-32-43-54-34-11-33-41
44-42-23-51-34
42-15-51 12-11-42-13-51-41
34-44-42-13-13
45-43-54-24 23-51-24-31-45
24-51-23-11-42-33-34

Cryptography Fundamentals
End of Module
References
 CompTIA Security+ (Exam SY0-401)

You might also like