Topic 2 Highlights - Cryptographic Tools
Topic 2 Highlights - Cryptographic Tools
Cryptosystems
Symmetric Key Encryption
In symmetric key encryption, the same keys are used for encrypting and decrypting
the information.
The sender and receiver must share a common key prior to exchanging information,
requiring a secure key establishment mechanism.
Symmetric key encryption relies on the implicit requirement that the sender and
receiver trust each other.
Limitations of symmetric key encryption include key establishment and trust issues,
which can be addressed by asymmetric key encryption schemes.
Asymmetric Key Encryption
In asymmetric key encryption, different keys are used for encrypting and decrypting
the information.
Every user in the system needs to have a pair of dissimilar keys: a private key and a
public key.
The public key is placed in a public repository, while the private key is kept secret.
Although public and private keys are related, it is computationally infeasible to find
one from the other.
When a sender wants to send data to a receiver, the sender obtains the receiver's
public key from the repository, encrypts the data, and transmits it. The receiver then
uses their private key to decrypt the ciphertext and obtain the plaintext.
Traditional Ciphers
Caesar Cipher
A mono-alphabetic substitution cipher where each letter of the plaintext is
substituted by another letter to form the ciphertext.
The substitution is done by shifting the alphabet by a fixed number of positions.
Vigenère Cipher
Uses a text string (e.g., a word) as a key, which is then used for doing a number of
shifts on the plaintext.
Each letter in the key determines the number of shifts for the corresponding
plaintext letter.
Affine Cipher
A mono-alphabetic substitution cipher where each letter in the alphabet is mapped
to its numeric equivalent, encrypted using a simple mathematical function, and
converted back to a letter.
Encryption is done using the function (a * x + b) mod 26, where 'a' and 'b' are
constants agreed upon by the sender and receiver.
Decryption is done using the function a^-1 (x - b) mod 26, where a^-1 is the modular
multiplicative inverse of 'a'.
Hash Functions
Introduction to Hash Functions
A hash function is a mathematical function that converts a numerical input value into
another compressed numerical value.
The input can be of arbitrary length, but the output (hash value or message digest) is
always of fixed length.
Hash functions are extremely useful and appear in almost all information security
applications.
Properties of Hash Functions
1. Pre-image resistance: Given a hash value, it should be computationally hard to find
any input that hashes to that value.
2. Second pre-image resistance: Given an input and its hash, it should be difficult to find
a different input with the same hash.
3. Collision resistance: It should be difficult to find two different inputs that result in the
same hash value.
Popular Hash Functions
1. Message Digest (MD) family: MD2, MD4, MD5, MD6
2. Secure Hash Algorithm (SHA) family: SHA-0, SHA-1, SHA-2 (SHA-224, SHA-256, SHA-
384, SHA-512)
3. RIPEMD (RACE Integrity Primitives Evaluation Message Digest): RIPEMD, RIPEMD-
128, RIPEMD-160, RIPEMD-256, RIPEMD-320
4. BLAKE family: BLAKE, BLAKE2s, BLAKE2b
Applications of Hash Functions
1. Password storage: Store password hashes instead of plaintext passwords in
databases.
2. Data integrity checks: Generate checksums on data files to ensure data correctness.
3. Pseudorandom generation and key derivation: Use hash values as random numbers
or derive keys from a random seed.
4. Proof of work algorithms: Create hash values that meet specific criteria (e.g., mining
difficulty in cryptocurrencies).