Lecture 2. Cryptography
Lecture 2. Cryptography
CYBERSECURITY
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?
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.
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: 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
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.
The sending device inputs the message into a hashing
algorithm and computes its fixed-length digest or
fingerprint.
5.3.2.1. Latest Hash Algorithms
If two users have the same password, they will also have the
same password hashes. A salt, which is a random string of
characters, is an additional input added to the password
before hashing.
This creates a different hash result even when the two
passwords are identical. Then, the database stores both the
hash and the salt. The same password generates a different
hash for different users, because the salt in each instance is
different. Meanwhile, the salt does not have to be secret since
it is a random number.
Salting prevents an attacker from using a dictionary attack to try
to guess passwords. Salting also makes it impossible to use
lookup tables and rainbow tables to crack a hash.111
Implementing Salting
The following recommendations will help ensure successful
implementation of salting: