0% found this document useful (0 votes)
21 views

u1-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

u1-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

!!!!!!YAMETO KUDASAIII!!!!!!

!!!UNIT1st!!!
History of cryptography
Cryptography began in ancient civilizations, such as Egypt, where hieroglyphics were sometimes
encoded. The Greeks created early cryptographic tools like the scytale, while the Romans used
ciphers like Julius Caesar's shift cipher for secure communication. During the Middle Ages, more
sophisticated techniques emerged, including the polyalphabetic Vigenère cipher, which resisted
frequency analysis.

In the 20th century, cryptography became crucial in wars, most notably with the German Enigma
machine during World War II. Today, modern cryptography relies on complex mathematical
algorithms like RSA and AES, essential for securing digital communications and data privacy.

Basics of Cryptography
Cryptography is the practice of encoding and decoding information in a way that only authorized
parties can read it. It involves the use of algorithms and techniques to transform plaintext (readable
data) into ciphertext (encrypted data) and vice versa.

Key Concepts:
1. Plaintext: The original, readable data that needs to be encrypted.
2. Ciphertext: The encrypted data that is unintelligible to unauthorized parties.
3. Encryption: The process of transforming plaintext into ciphertext using an algorithm.
4. Decryption: The process of transforming ciphertext back into plaintext using the correct
algorithm and key.
5. Algorithm: The mathematical procedure or set of rules used for encryption and decryption.

Types of Cryptography
A. Symmetric-Key Cryptography:
Uses the same key for both encryption and decryption.
Examples: AES (Advanced Encryption Standard), DES (Data Encryption Standard), 3DES.
B. Asymmetric-Key Cryptography:
Uses a pair of keys: a public key and a private key.
Data encrypted with the public key can only be decrypted with the corresponding private key.
Examples: RSA (Rivest-Shamir-Adleman), Diffie-Hellman key exchange.
C. Hash Functions:
Creates a fixed-size output (hash value) from an input of any size.
Used for data integrity, password storage, and digital signatures.
Examples: SHA-1, SHA-256, MD5
Security implications of cryptography.
Cryptography is essential for securing data, but several security implications must be
considered. Poor key management, such as insecure storage, weak key lengths, can expose
sensitive information. Using outdated algorithms like DES or MD5, can make systems
vulnerable. Weak implementations of cryptographic systems, poor algorithm choices, and
human factors like phishing or weak passwords can also compromise security.

To mitigate these risks, it's crucial to use modern algorithms, implement strong key
management practices, regularly update systems, and educate users on security best
practices.

Caesar Cipher: A Classic Encryption Technique


The Caesar cipher is one of the simplest and earliest known encryption techniques. Named after
Julius Caesar, who is believed to have used it to communicate with his generals, it's a type of
substitution cipher.

How it Works:
1. Encryption: Each letter in the plaintext is replaced by a letter some fixed number of positions
(the shift) down the alphabet.

For example, with a shift of 3:

• A becomes D
• B becomes E
• C becomes F

If the end of the alphabet is reached, the cipher wraps around (i.e., Z becomes C with a shift of 3)

2. Decryption: To decrypt the ciphertext, the process is reversed by shifting letters in the opposite
direction.

Example:

• Plaintext: "HELLO"
• Shift: 3
• Ciphertext: "KHOOR"

Mono-alphabetic cipher
A mono-alphabetic cipher is a type of substitution cipher where each letter in the plaintext is
replaced with a corresponding letter in the ciphertext using a fixed substitution throughout the
message. Unlike the Caesar cipher, which shifts letters by a fixed amount, a mono-alphabetic cipher
allows any arbitrary substitution, making it more versatile.
How it Works:
1. Encryption: Each letter of the plaintext is replaced by a unique letter from a shuffled or random
alphabet.

For example, if A is substituted with M, B with Q, C with X, and so on, this pattern is followed
consistently for the entire message.

2. Decryption: The receiver, knowing the substitution scheme, reverses the process to retrieve
the original message.

Example:

Substitution key: A = M, B = Q, C = X, D = Z, etc.

Plaintext: "HELLO"

Ciphertext: "XMZZP"

Hill cipher
The Hill cipher is a polygraphic substitution cipher that encrypts blocks of text rather than individual
letters. It is based on linear algebra, using matrix multiplication to encrypt and decrypt messages.
Named after its inventor, Lester S. Hill, the cipher was introduced in 1929 and is one of the first
ciphers to use matrix algebra in cryptography.

Vigenère cipher
The Vigenère cipher is a polyalphabetic substitution cipher that improves upon the Caesar cipher by
using multiple shifts based on a keyword. It was named after the French diplomat Blaise de Vigenère,
though it was actually first described by Giovan Battista Bellaso.

How it Works:
1. Key (Keyword): The Vigenère cipher uses a keyword to determine the shifts for each letter in
the plaintext. The keyword is repeated until it matches the length of the plaintext. Each letter of
the keyword represents a shift value based on its position in the alphabet (A=0, B=1, ..., Z=25).
2. Encryption: Each letter in the plaintext is shifted by a number of positions determined by the
corresponding letter in the keyword.
• If the letter is "A", no shift is applied (A=0).
• If the letter is "B", the shift is by 1, and so on.

For example:

Plaintext: "HELLO"

Keyword: "KEY"

Repeated keyword: "KEYKE"


• H (7) + K (10) → R (17)
• E (4) + E (4) → I (8)
• L (11) + Y (24) → J (9)
• L (11) + K (10) → V (21)
• (14) + E (4) → S (18)

Decryption:
To decrypt, the same keyword is used, but the shifts are applied in the opposite direction (i.e.,
subtract the shift instead of adding).

One-Time Pad (OTP)


The one-time pad (OTP) is a type of symmetric-key encryption that is considered theoretically
unbreakable if used correctly. It's the only known provably secure encryption method.

How it works:
1. Random Key: A random key is generated that is the same length as the plaintext.
2. XOR Operation: Each bit of the plaintext is XORed (exclusive or) with the corresponding bit of
the key to produce the ciphertext.
3. Key Disposal: The key is used only once and then discarded.

Rail-fence Cipher: A Transposition Cipher


The rail-fence cipher is a simple transposition cipher that works by rearranging the letters of the
plaintext in a specific pattern.

How it works:
1. Number of Rails: A number of "rails" is chosen.
2. Zig-zag Pattern: The plaintext is written in a zigzag pattern, going up and down between the
rails.
3. Read Out: The ciphertext is read out in a linear fashion, following the zigzag pattern.

Example:

• Number of Rails: 3
• Plaintext: "HELLO WORLD"
• Zigzag Pattern:
H W O
ELRL
L O D

Ciphertext: "HLWORELD"

4. Decryption: To decrypt the ciphertext, the same number of rails and zigzag pattern are used,
but the ciphertext is written in the zigzag pattern and then read out in a linear fashion.
Introduction to Number Theory
Number theory is a branch of mathematics that deals with the properties of integers. One of the
fundamental concepts in number theory is the notion of prime numbers.

Prime Number Generation:


There are several methods to generate prime numbers:

1. Trial Division: This is the simplest method. To check if a number n is prime, divide it by all
integers from 2 to √n. If none of these divisions result in a remainder of 0, then n is prime.
2. Sieve of Eratosthenes: This is an efficient algorithm to find all prime numbers up to a given
limit. It works by iteratively marking multiples of prime numbers as composite.
3. Random Prime Generation: To generate a large prime number, a random number is
chosen and then tested for primality using probabilistic algorithms.

Primality Testing:
Determining whether a given number is prime is a fundamental problem in number theory. There are
various algorithms for primality testing:

1. Deterministic Primality Tests: These algorithms can definitively determine whether a


number is prime or composite. Examples include the AKS primality test and the Lucas-Lehmer
test for Mersenne primes.
2. Probabilistic Primality Tests: These algorithms provide a high probability that a number is
prime but cannot guarantee it. Examples include the Miller-Rabin test and the Fermat primality
test.

Fermat’s Little Theorem


If p is a prime number and a is an integer such that a is not divisible by p (i.e., gcd (a, p) =1) then:

ap-1=1(mod p)

This means that for any integer a that is not divisible by p, raising a to the power of p−1p-1p−1, and
then taking the remainder when divided by p, will always give 1.

Euler's Theorem
Euler's Theorem is a generalization of Fermat's Little Theorem. It states that if n is a positive integer
and a is an integer relatively prime to n (i.e., their greatest common divisor is 1), then:

a^(φ(n)) ≡ 1 (mod n)

Here, φ(n) is the Euler's totient function, which gives the number of positive integers less than or
equal to n that are relatively prime to n.
Symmetric Key Cryptography
Symmetric key cryptography, also known as secret-key cryptography, is a type of encryption
where the same key is used for both encryption and decryption. This key must be shared
securely between the sender and receiver.

Key Principles:

1. Shared Secret: The key is kept secret and shared only between the authorized parties.
2. Encryption and Decryption: The same key is used to encrypt the plaintext and decrypt
the ciphertext.
3. Algorithm: A mathematical function or algorithm is used to transform the plaintext into
ciphertext and vice versa.
4. Key Length: The length of the key determines the security of the encryption. Longer
keys are generally more secure.

Encryption and Decryption Algorithms


Encryption and decryption algorithms are the core components of cryptographic systems. They are
mathematical functions that transform plaintext into ciphertext and vice versa, respectively.

Types of Algorithms:
Symmetric Key Algorithms:
1. DES (Data Encryption Standard): A 56-bit block cipher widely used in the past but now
considered insecure due to its relatively short key length.
2. 3DES (Triple DES): A variant of DES that uses three keys to enhance security.
3. AES (Advanced Encryption Standard): A modern block cipher that supports key lengths
of 128, 192, and 256 bits, making it more secure than DES.

Asymmetric Key Algorithms:


1. RSA (Rivest-Shamir-Adleman): A public-key cryptosystem that uses large prime numbers
for encryption and decryption.
2. Diffie-Hellman Key Exchange: A protocol for securely exchanging cryptographic keys over
an insecure channel.

How Encryption and Decryption Work:


1. Key Generation: A key (or pair of keys in asymmetric cryptography) is generated and shared
securely between the sender and receiver.
2. Encryption: The plaintext is transformed into ciphertext using the encryption algorithm and
the key.
3. Decryption: The ciphertext is transformed back into plaintext using the decryption algorithm
and the appropriate key.
Claude Shannon’s Theory of Diffusion and Confusion
Claude Shannon, often considered the father of modern digital communication and cryptography,
introduced the concepts of diffusion and confusion in his ground-breaking work "A Mathematical
Theory of Cryptography" (1949). These ideas are essential to understanding how secure encryption
systems are designed to protect information.

Diffusion:
Diffusion refers to the process of spreading out the influence of a single plaintext symbol over many
ciphertext symbols. The goal is to ensure that changing a single bit of the plaintext affects many bits
of the ciphertext, making it more difficult for an attacker to identify patterns. Diffusion is achieved
through permutations or transformations that mix the data.

Confusion:
Confusion refers to making the relationship between the ciphertext and the encryption key as
complex and unintelligible as possible. The goal is to ensure that the key does not correlate directly
to the ciphertext, making it difficult for an attacker to reverse-engineer the key even if they have
access to the ciphertext.

Avalanche Effect
The Avalanche Effect is a critical property of cryptographic algorithms, particularly in block ciphers
and hash functions. It refers to the phenomenon where a small change in the input (such as flipping
a single bit) produces a significantly different output, such that even minor modifications lead to
unpredictable and widespread changes.

Feistel Cipher
The Feistel Cipher structure is a symmetric structure used in the design of block ciphers. Named
after Horst Feistel, it forms the basis for many well-known encryption algorithms, such as DES (Data
Encryption Standard). The Feistel structure splits the plaintext block into two halves and processes
them over multiple rounds using a series of mathematical functions and the encryption key.

Common symmetric key algorithms


1. DES (Data Encryption Standard): A 56-bit block cipher widely used in the past but now
considered insecure due to its relatively short key length.
2. 3DES (Triple DES): A variant of DES that uses three keys to enhance security.
3. AES (Advanced Encryption Standard): A modern block cipher that supports key lengths
of 128, 192, and 256 bits, making it more secure than DES.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy