Lecture 2. Cryptography PDF
Lecture 2. Cryptography PDF
Lecture 2. Cryptography PDF
CYBERSECURIT
Y II
LECTURE II – Cryptography
1.WHY WE NEED
CRYPTOGRAPHY?
While networks can be made relatively secure, there
is always the possibility that the information can be
intercepted at some point or unauthorized access
gained. When this happens, there is a final defense –
encryption.
1.WHY WE NEED CRYPTOGRAPHY
(Cont….)
2. WHAT IS CRYPTOGRAPHY?
It is coming from a Greek word “krypto’s” means
“Hidden Secrets”.
The goal is to conceal the information even if the
information is intercepted by the others.
Thus, it takes an exceedingly important role to have
Confidentiality, Integrity, Availability (CIA Triad) in our
technology such as network communications,
internet, e-mails, cell phones, etc.
3. BASIC TERMS IN CRYPTOGRAPHY
Plain text; the message.
Cipher Text; unintelligible version of the message.
Encryption; the operation to transform the plain text into the
cipher text.
Decryption; the operation to transform the cipher text into
the
plain text.
Cipher (or cypher); the algorithm to carry out encryption
and
decryption.
Key; crucial information used by cipher and only known for
4. HISTORY OF CRYPTOGRAPHY
Since ancient times the division between one side and
its adversary has made it important to search for a way
of hiding messages while information is in transit.
Classical algorithms are usually defined as those
invented pre-computer, up to around the 1950s. These
techniques tended to work on the actual letters
themselves, rather than other representations such as
bits and bytes.
During World War II, ciphers were developed, which rely
on complex gearing mechanisms to encipher the text.
These include the Enigma Cipher and the Lorenz
Cipher.
4.1. Hieroglyph
The first known cryptography method used by
Egyptians 4000 years ago. They make contact by
messages written in hieroglyph.
4.1. Hieroglyph
4.2. Caesar Cipher
Perhaps the most famous of these ancient encryption
systems is the Caesar cipher, so called by the ancient
historian of Rome, Suetonius.
This cipher is a shift cipher; that is it relies on a shift of the
alphabet according to some key.
It is said that Caesar used a simple version with a shift of
3, but, of course, any number of shifts could be applied
from 1 to 25. Another shift, that is shift 26, will bring the
alphabet back to its original state, as there are 26
characters in the alphabet.
A B C D E F
A B C D E F
A B C D E F
A B C D E F
Hash Functions
5.1. Symmetric Key Cryptography
The sender and the receiver use the same key to
encrypt and decrypt the message. Also, known as
private key encryption.
same pre- same pre-
shared key shared key
Plain Cipher Plai
Sende Receive
Text encryption Text decryption n
r Text r
5.1.1. Symmetric Encryption
Algorithms
3DES (triple DES)
IDEA
AES
3DES (triple DES)
Digital Encryption Standard (DES) is a symmetric block
cipher with 64-bit block size that uses a 56-bit key. It
takes a 64-bit block of plaintext as input and outputs
a 64-bit block of ciphertext. It always operates on
blocks of equal size and it uses both permutations and
substitutions in the algorithm. A permutation is a way
of arranging all elements of a set.
Triple DES encrypts data three times and uses a
different key for at least one of the three passes,
giving it a cumulative key size of 112 to 168 bits. 3DES
is more resistant to attack, but it is much slower than
DES.
The 3DES encryption cycle is as follows:
See
IDEA
The International Data Encryption Algorithm (IDEA) uses
64-bit blocks and 128-bit keys. IDEA performs eight
rounds of transformations on each of the 16 blocks that
results from dividing each 64-bit block (64 / 4).
IDEA was the replacement for DES, and now PGP (Pretty
Good Privacy) uses it. PGP is an encryption program
that provides privacy and authentication in data
communication. GNU Privacy Guard (GnuPG) is a
licensed, free version of PGP.
AES
The Advanced Encryption Standard (AES) has a fixed
block size of 128 bits with a key size of 128, 192, or
256 bits. The National Institute of Standards and
Technology (NIST) approved the AES algorithm in
December 2001. The U.S. government uses AES to
protect classified information.
Alice Bob
Bob sends his public key
5.2.1 Asymmetric Key Algorithms
RSA (Reverse Shamir Adleman)
Diffie-Hellman
ElGamal
Elliptic Curve Cryptography (ECC)
RSA (Reverse Shamir Adleman)
Uses the product of two very large prime key numbers
with an equal length of between 100 and 200
digits(1024-bits and 2048-
bits). Browsers use RSA to establish a secure connection.
Diffie-Hellman
password.
oNever reuse a salt.
To store a password:
Use CSPRNG(Cryptographically Secure Pseudorandom
Number
Generator) to generate a long, random salt.
Add the salt to the beginning of the password.
Hash it with SHA-256, a standard cryptographic hash
function.
Save the salt and the hash in the user’s database
record.
To validate a password:
Retrieve a user’s salt and hash from the database.
Add the salt to the password and hash it with the same
hash
function.
the user
trying to log in to the one stored in the database.
If the hashes do not match, the password the user has
just
tried to log in with is incorrect.
5.3.7. What Is an HMAC Operation?
William
Pollock, (2019). Linuz Basics for Hackers.
Na. Vikraman, (2021). Cryptography and Network Security.
Edition.
Seepanshu Rajput, (2020). Cryptography in Network Security.