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:
https://www.youtube.com/watch?v=23JangqRhIc
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.
See Video:
https://www.youtube.com/watch?v=909pwcyqVFQ
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.
SEE: https://www.youtube.com/watch?v=aaDcV4gLX40
5.2. Asymmetric Key Cryptography
It is also known as public key encryption. It requires two
different keys. Public key is used to encrypt the message
and the private key is used to decrypt the message. There
is no key exchange. If Alice wants to send a message to
Bob. First, Alice
has to request Bob’s public key to encrypt the message.
Then, Bob opens that message with his private key. So,
the keys are asymmetric.
Requesting Bob’s public key
Alice Bob
Bob sends his public key
5.2.2. Key Management
Key management includes the generation, exchange,
storage, use and replacement of keys used in an
encryption algorithm.
It is the most difficult part of designing a
cryptosystem.
Many cryptosystems have failed because of mistakes
in their key management procedures.
In practice, most attacks on cryptographic systems
target the key management level, rather than the
cryptographic algorithm itself.
There are several essential characteristics of key
management to consider. Two terms used to describe
keys are:
Key length — Also called the key size, this is the length
of the key in bits.
Keyspace — This is the number of possibilities that a
specific key length can generate.
SEE: https://www.youtube.com/watch?v=cczlpiiu42M
5.3.2. Hash Algorithms
Hash functions help to ensure that a user or
communication error does not change data
accidentally.
For instance, a sender may want to make sure that no
one
alters a message on its way to the recipient.
password.
Never reuse a salt.
Always hash on the server, in a web application.
To validate a password:
William
Pollock, (2019). Linuz Basics for Hackers.
Na. Vikraman, (2021). Cryptography and Network Security.
Edition.
Seepanshu Rajput, (2020). Cryptography in Network Security.