Week 4
Week 4
INF 203
Content
• Cryptography basics
• Encoding
• Hashing
• Encryption
Cryptography
Blowfish Diffie-Helman
AES RSA
RC4 ECC
DES ElGamal
RC5 DSA
The Data Encryption Standard (DES)
• Algorithm Structure:
o DES operates on 64-bit blocks of plaintext and uses a 56-bit key for encryption and
decryption.
o The algorithm consists of 16 rounds of permutation and substitution (Feistel cipher
structure), each involving the use of the encryption key.
o During each round, the plaintext undergoes permutation and substitution operations
based on the key, resulting in a ciphertext block.
o The final ciphertext block is produced after all 16 rounds are completed.
Hashing
• A hash function is any function that can be
used to map data of arbitrary size to fixed-
size values. Hashing is the transformation
of a string of characters into a fixed-length
value (usually shorter) or key that
represents the original string.
• Usually, hashing is a one-way operation.
We assume there is only one possible way
to restore source text: brute forcing (in
some cases rainbow tables might help to
brute force faster)
Hashing
• Cryptographic hash function must have six main properties:
• Deterministic: the same message always results in the same hash;
• Quick: it is quick to compute the hash value for any given message;
• One-way function: it is infeasible to generate a message from it’s hash value except brute forcing;
• Avalanche effect: a small change to a message should change the hash value so extensively that
the new hash value appears uncorrelated with the old hash value;
• Collision resistant: it is infeasible to find two different messages with the same hash value
• Pre-image attack resistant: a pre-image attack on cryptographic hash functions is aimed to find a
message that has a specific hash value. A cryptographic hash function should resist attacks on it’s
pre-image.
Hashing
Hashing
• The most known hashing algorithms:
1. MD5
2. SHA-1
3. SHA-256
4. SHA-512
Applications
of Hashing
• Data Integrity
• Password Storage
• Digital Signatures
• Data Indexing and Retrieval
Here are some free platforms
where students can train in
cryptography:
1. Cryptohack:
Cryptohack is a platform that offers free interactive challenges to help users learn and practice
cryptography. It covers various topics such as encryption, decryption, hashing, and more. Users can solve
challenges at their own pace and track their progress.
2. CryptoPals Crypto Challenges:
CryptoPals provides a series of cryptography challenges aimed at teaching cryptographic concepts through
hands-on exercises. The challenges cover a wide range of topics from basic encryption algorithms to more
advanced cryptographic protocols. Users can work through the challenges individually or in groups.
3. OverTheWire - Narnia:
OverTheWire hosts a collection of hacking and security challenges, including the Narnia series, which covers
basic cryptography concepts. Participants can solve challenges by exploiting vulnerabilities in cryptographic
implementations. The platform offers a fun and engaging way to learn cryptography.
4. HackerRank - Cryptography Challenges:
HackerRank offers a variety of coding challenges, including a section dedicated to cryptography. Participants
can solve challenges related to encryption, decryption, and other cryptographic operations using
programming languages such as Python, Java, and C++. The platform provides a supportive community and
resources to help users improve their skills.