ISF UNIT II
ISF UNIT II
Communication Security:
Communication Security is a critical aspect of cybersecurity that focuses on ensuring the
protection of data while it is transmitted between systems, devices, or networks. Its main goal
is to maintain confidentiality, integrity, authenticity, and availability during the
communication process. Here’s a detailed explanation:
• Integrity: Protects data from being tampered with or altered during transmission.
• Authenticity: Confirms that the parties involved in communication are who they
claim to be.
• Encryption:
• Authentication:
• Protocols:
o SSL/TLS: Secures web communication.
• Symmetric Key Encryption: Uses the same key for encryption and decryption (e.g.,
AES).
• Asymmetric Key Encryption: Uses a public key for encryption and a private key for
decryption (e.g., RSA).
5. Emerging Trends
• Quantum Cryptography: Advanced techniques to ensure secure communication in
the face of future quantum computing threats.
• Securing IoT Communication: Protecting data exchanged between interconnected
smart devices.
Introduction to cryptography:
Cryptography is the method of protecting information so that only the right people can see it,
even if others (called adversaries) try to steal it. It creates special rules (called protocols) to
keep messages safe between two people. Secure communication means no one else can read
the message except the sender and the receiver. An adversary is someone who tries to steal or
change the information.
• Data Integrity: Making sure the information stays correct and is not changed.
• Authentication: Checking that the information really comes from the right person.
• Non-repudiation: Making sure that a person cannot deny that they sent a message or
signed a document.
EX:
Imagine two friends, Alice and Bob.
Alice wants to send a secret message m to Bob so that no one else can understand it.
Here’s how it works:
• First, Alice takes her message (called Plaintext) and hides it by turning it into a secret
code using a special key (k).
Where:
• C = Ciphertext
• E = Encryption
• D = Decryption
• m = Message
• k = Key
Example: Caesar Cipher (Shift Cipher)
• A becomes D
• B becomes E
• C becomes F, and so on.
If the original word is:
Plaintext: Geeksforgeeks
Ciphertext: Jhhnvirujhhnv
Types of Cryptography:
There are different kinds of cryptography, and each one is used for different purposes:
1. Symmetric-key cryptography:
o Here, the same key is used to lock (encrypt) and unlock (decrypt) the
message.
o Both Alice (sender) and Bob (receiver) must keep the key secret to stay safe.
o The public key is shared with everyone, but the private key is kept secret.
o Anyone can encrypt a message using the public key, but only the person with
the private key can read it.
3. Hash functions:
o A hash function takes any data and converts it into a fixed-size code (like a
fingerprint).
o Even a tiny change in the data will make a totally different hash!
Applications of Cryptography:
o It protects your bank passwords, credit card numbers, and other important
details while shopping or banking online.
• Digital signatures:
o They help prove that a digital document is authentic and hasn’t been
changed.
• Password protection:
o Passwords are often encrypted so that even if hackers steal them, they can’t
read them easily.
• Key management:
o Keeping keys safe is very important. If someone steals the key, they can read
all the secret messages.
• Quantum computing:
o In the future, quantum computers might become so powerful that they can
break today’s cryptographic algorithms.
• Human error:
Cryptosystems:
A cryptosystem is when we put cryptographic techniques and supporting tools together to
provide security for information.
It is also called a cipher system.
Components of a Cryptosystem:
• Plaintext:
The real message that needs protection.
• Encryption Algorithm:
A mathematical method that changes the plaintext into a secret message (ciphertext)
using an encryption key.
• Ciphertext:
The jumbled message that is sent across public channels.
Anyone can see it, but without the correct key, they can't understand it.
• Decryption Algorithm:
A method to turn the ciphertext back into the original plaintext using a decryption key.
• Encryption Key:
A secret value known to the sender, used to encrypt the plaintext.
• Decryption Key:
A secret value known to the receiver, used to decrypt the ciphertext.
(It is related to the encryption key, but may not always be the same.)
• Key Space:
All the possible decryption keys that could be used.
• Interceptor (Attacker):
A bad person who can see the ciphertext and might even know the decryption method,
but should never know the secret key!
Types of Cryptosystems
• Both people must share the same secret key before they communicate.
•
Important Points:
Examples:
• IDEA
• Blowfish
Challenges:
How it Works:
Important Points:
• Every user in this system needs to have a pair of dissimilar keys, private
key and public key. These keys are mathematically related − when one key is used
for encryption, the other can decrypt the ciphertext back to the original plaintext.
• It requires to put the public key in public repository and the private key as a well-
guarded secret. Hence, this scheme of encryption is also called Public Key
Encryption.
• Though public and private keys of the user are related, it is computationally not
feasible to find one from another. This is a strength of this scheme.
• When Host1 needs to send data to Host2, he obtains the public key of Host2 from
repository, encrypts the data, and transmits.
What is Encryption?
Data can be secured with encryption by being changed into an unintelligible format
that can only be interpreted by a person with the proper decryption key. Sensitive
data, including financial and personal information as well as communications over the
internet, is frequently protected with it.
Application of Encryption
• Data Storage: To prevent unwanted access to data that has been stored.
What is Decryption?
To make encrypted data comprehensible again, it must first be decrypted and then put
back into its original format. To access and utilize the protected information,
authorized parties must follow this procedure.
• HTTPS websites: Encrypt user data to prevent third parties from intercepting it.
• Encrypted Email Services: Email services that use encryption, like ProtonMail,
protect email contents.
• 3DES (Triple DES): Applies the DES algorithm three times for enhanced
security but is being phased out due to performance issues
4. Hybrid Encryption: Many systems use both symmetric and asymmetric encryption
to leverage the strengths of each. For example, during a secure transaction,
asymmetric encryption can be used to establish a secure connection, while symmetric
encryption is utilized for the actual data transfer due to its speed
Importance of Encryption in Cybersecurity
• Data Confidentiality: Encryption ensures that sensitive information remains private
and unreadable to unauthorized users, protecting it from data breaches and
cyberattacks
• Data Integrity: It helps verify that data has not been tampered with during
transmission, maintaining the accuracy and authenticity of information
Substitution Techniques
1. Caesar Cipher: This is the simplest known substitution cipher where each letter in
the plaintext is shifted by a fixed number. For example, with a shift of three, 'A'
becomes 'D', 'B' becomes 'E', and so on. The encryption can be expressed
mathematically as C=E(P)=(P+k)mod 26C=E(P)=(P+k)mod26
2. Playfair Cipher: This multiple letter cipher encrypts pairs of letters (digrams) instead
of single letters. It uses a 5x5 matrix constructed from a keyword. For example, if the
keyword is "MONARCHY", it fills in the matrix and then applies specific rules based
on letter positions
3. Vigenère Cipher: Involves using a keyword to apply different shifts to letters in the
plaintext. Each letter of the keyword represents a different Caesar cipher, providing
more complexity and making it resistant to frequency analysis
4. Kasiski Examination: A method to break the Vigenère cipher that looks for repeated
sequences in the ciphertext, which suggests a periodicity in the cipher, allowing for
the deduction of the key length
Transposition Techniques
Transposition ciphers rearrange the letters of the plaintext to create ciphertext without
altering the actual letters used. Here are two notable examples:
1. Rail Fence Cipher: This technique writes the plaintext in a zigzag pattern and then
reads off the lines horizontally. For instance, "MEET ME AT THE PARK" could be
encrypted as "METTEAHMTTPERK" by rearranging based on a designated depth
2. Columnar Transposition: This method writes the message in rows and then
permutes the columns based on a key. The output is a rearranged sequence of letters,
which can significantly enhance security
•
Conclusion
While classical encryption techniques may appear simplistic and insecure compared to
modern cryptography, they represent a crucial historical foundation. Understanding
methods such as substitution and transposition ciphers enhances knowledge of how
secure communication evolved and informs the use of contemporary encryption practices.
These techniques not only shaped cryptographic history but also provide a valuable
educational resource for understanding the intricate field of cryptography today.
3. Covert Channels:
• Covert channels are used in cryptographic systems to convey information
indirectly. These channels operate in a hidden manner, often combining
encryption with other techniques to ensure secure communication.
Authentication and encryption are essential for establishing reliable covert
channels, minimizing detectability while transmitting sensitive data
4. Hybrid Approaches:
• Many cryptographic systems implement hybrid approaches that combine both
symmetric and asymmetric methods. For instance, they might use asymmetric
encryption to exchange a symmetric key securely, which is then used for fast
data encryption during the session. This balances security with efficiency in
transmitting large volumes of data
3. Authentic Channels: These prevent tampering but may not guarantee that the data
cannot be overheard. They secure the integrity of the information being transferred
while possibly leaving some aspects of the confidentiality vulnerable
Types of Ciphers
numbers. It is a very weak technique for hiding text. In Caesar’s cipher, each alphabet in the message
is replaced by three places down. Let’s see one example. The plain text is EDUCBA. As a Caesar
cipher, each alphabet is replaced by three places down. So that E will be replaced by H, D will be
cipher comes into the picture. In monoalphabetic, each alphabet in plain text can be
replaced by any other alphabet except the original alphabet. That is, A can be replaced by
and D to Z, etc. Mono alphabetic cipher causes difficulty in cracking the message as there are
random substitutions and a large number of permutations and combinations are available.
is in a monoalphabetic, we replace the alphabet with any other random alphabet except the
fixed alphabet or set of alphabets. The substitution alphabet is replaced with the fixed one.
For example, replace A with x, E with B, S with A, etc., or replace A with E, x or L, B with T, A,
Z, etc.
alphabet’s Block is replaced with another block of alphabets. Replace EDUCBA with XYQLAB.
In this case, EDUCBA will replace with XYQLAB, but EDU can be replaced with another set of
block. Let’s assume EDU will replace with LOD. In this type of cipher, plain text replacement is
encrypt the text. The table contains 26 alphabets written in different rows; each alphabet is
cyclically shifted to the left according to the previous alphabet, equivalent to the 26 possible
Caesar Ciphers. The cipher uses a different alphabet from one of the rows at various points in
Let’s consider Original text is Educba, and the keyword is Apple. For the encryption process,
E is paired with A, the first letter of the original text, and E, is paired with A, the first letter of
the key. So use row E and column A of the Vigenère square, which is E. Similarly, for the
second letter of the original text, the second letter of the key is useful, and the letter at row d
and column p is s. The rest of the original text is enciphered in the same way. The final
6. Playfair Cipher
Playfair cipher is also called Playfair square. It is a cryptographic technique that is used o
encrypt the data. The Playfair cipher process is as follows:
• Encryption process.
Let’s discuss the above-mentioned steps in detail manner the creation and population of the
matrix. It uses a 5 * 5 matrix to store the keyword or the key, which is used for
the encryption and decryption process.
1. Enter the keyword in the matrix in a row-wise manner, i.e., from left to right and top
to bottom.
3. Fill the remaining spaces with the rest of the alphabet (A – Z) that were not a part of
the keyword.
Note: while doing so, combine I and J in the same cell of the table. i.e., If I or J is present in
the keyword, discard both I and J while filling the remaining space encryption process.
• Break the alphabet into groups (each group must contain two values). The encryption
processes will be on these groups.
• If both alphabets in the group are the same, add x after the first alphabet.
• If both the alphabets in the group are present in the same row of the matrix, replace
them with the alphabets to their immediate right, respectively. If the original group is
on the right side of the row, then wrapping around the row’s left side happens.
• If both the alphabets in the group are present in the same column, replace them with
the next immediate alphabets respectively. If the original group is on the bottom side
of the row, then wrapping around to the row’s top side happens.
• If both the alphabets in the group are not in the same row or column, replace them
with the alphabet in the same row immediately but at the other pair of corners of the
rectangle, which the original group defines.
7. Hill Cipher
Hill cipher works on multiple alphabets at the same time. Hill cipher works as follows:
2. Organize the plain text message as a matrix of numbers based on the above step in
number format. The resultant matrix is a plain text matrix.
3. Multiply the plain text matrix with a randomly chosen key. Note that the key matrix
must be the size of n*n, where n stands for the number of rows in a plain text matrix.
5. Calculate the mod 26 value of the above matrix, i.e., matrix results in step 4.
Cryptanalysis :
Cryptology has two parts namely, Cryptography which focuses on creating secret codes
and Cryptanalysis which is the study of the cryptographic algorithm and the breaking of
those secret codes. The person practicing Cryptanalysis is called a Cryptanalyst. It helps
us to better understand the cryptosystems and also helps us improve the system by finding
any weak point and thus work on the algorithm to create a more secure secret code. For
example, a Cryptanalyst might try to decipher a ciphertext to derive the plaintext. It can
help us to deduce the plaintext or the encryption key.
Types of attacks include ciphertext-only attacks, where only encrypted messages are
available, known-plaintext attacks, where both plaintext and ciphertext are known,
and chosen-plaintext/ciphertext attacks, where the attacker can encrypt or decrypt
specific data to expose the encryption scheme.
Parts Of Cryptology
To determine the weak points of a cryptographic system, it is important to attack the
system. This attacks are called Cryptanalytic attacks. The attacks rely on nature of the
algorithm and also knowledge of the general characteristics of the plaintext, i.e., plaintext
can be a regular document written in English or it can be a code written in Java.
Therefore, nature of the plaintext should be known before trying to use the attacks.
A hash function takes an input (or "message") and produces a fixed-size string of characters, which is typically
a sequence of numbers and letters. This output is known as the hash value or digest. Hash functions are
essential in several fields, especially in cryptography, where they help ensure data integrity and security.
1. Deterministic: The same input will always produce the same output hash value.
2. Fixed Output Size: Regardless of the input size, the output length remains constant.
4. Collision Resistance: It should be challenging to find two different inputs that produce the same hash
output, which is crucial for maintaining integrity.
5. Non-reversibility: It should not be feasible to regenerate the input from its hash value.
There are many hash functions that use numeric or alphanumeric keys. This article focuses on discussing
different hash functions:
1. Division Method.
2. Multiplication Method
3. Mid-Square Method
4. Folding Method
6. Universal Hashing
7. Perfect Hashing
1. Division Method
The division method involves dividing the key by a prime number and using the remainder as the hash value.
h(k)=k mod m
In the multiplication method, a constant ?A (0 < A < 1) is used to multiply the key. The fractional part of the
product is then multiplied by ?m to get the hash value.
h(k)=⌊m(kAmod1)⌋
3. Mid-Square Method
In the mid-square method, the key is squared, and the middle digits of the result are taken as the hash value.
Steps:
4. Folding Method
The folding method involves dividing the key into equal parts, summing the parts, and then taking the modulo
with respect to ?m.
Steps:
Cryptographic hash functions are designed to be secure and are used in cryptography. Examples include MD5,
SHA-1, and SHA-256.
Characteristics:
• Pre-image resistance.
• Collision resistance.
6. Universal Hashing
Universal hashing uses a family of hash functions to minimize the chance of collision for any given set of
inputs.
h(k)=((a⋅k+b)modp)modm
Where a and b are randomly chosen constants, p is a prime number greater than m, and k is the key.
7. Perfect Hashing
Perfect hashing aims to create a collision-free hash function for a static set of keys. It guarantees that no two
keys will hash to the same value.
Types:
• Minimal Perfect Hashing: Ensures that the range of the hash function is equal to the number of keys.
• Non-minimal Perfect Hashing: The range may be larger than the number of keys.
• Data Integrity: Used to verify that data has not been altered during transfer or storage by comparing
hash values before and after the data transmission.
• Password Storage: Instead of storing plaintext passwords, systems store their hash values for security
reasons. When a user inputs their password, it is hashed and compared with the stored hash.
• Digital Signatures: Hash functions create a unique hash for messages, which can be encrypted with a
private key to ensure their authenticity.
• Cryptographic Protocols: Hash functions are integral to many security protocols, including SSL/TLS
for secure data transmission over networks.
• MD5: Once widely used, this hash function outputs a 128-bit hash value. Due to vulnerabilities, its use
is discouraged in favor of stronger functions.
• SHA-1: A 160-bit function that has known vulnerabilities and is also being phased out for more secure
algorithms.
• SHA-256: Part of the SHA-2 family, it generates a 256-bit hash and is regarded as secure for
contemporary applications.
Hash functions are essential for ensuring data integrity by generating unique hash values that
verify data authenticity and detect alterations.
1. Data Authenticity: Hash functions create a fixed-size output, known as a hash value or digest, from
input data. This output serves as a unique representation of the data, allowing systems to confirm that
the data has not been changed. If the hash values match at different points (e.g., before and after
transmission), it indicates that the data remains intact and unaltered
2. Verification Mechanism: Hash functions enable the verification of data integrity through a process
wherein the original data is hashed, and its hash value is stored or transmitted alongside the data. Upon
retrieving or receiving the data, the hash is recalculated and compared to the original hash value. If
both hashes are equal, data integrity is confirmed
3. Collision Resistance: A strong hash function aims to minimize the chances of collision—where two
different inputs produce the same hash value. This property is critical in preventing attackers from
substituting legitimate data with malicious data while maintaining the same hash. Thus, collision
resistance ensures that each unique data input corresponds to a distinct hash value, further securing data
integrity
4. Practical Applications: Hash functions are widely utilized in various scenarios for ensuring data
integrity, including:
• Digital Signatures: Hash functions are utilized alongside encryption to create digital
signatures, which provide proof of data integrity and authenticity
• File Integrity Checks: During file transfers or storage, hash values can be used to detect any
alterations or corruption, ensuring the file's integrity remains intact
• Check Summation: They are used in checksums, where hash values help verify data
transmission correctness, making it easier to detect errors in data
Hashing functions transform data into a fixed-length string of characters, known as a hash value or hash code.
This process ensures that even a small change in the input data results in a completely different hash value, a
property known as the avalanche effect. Hash functions are widely used for various security applications,
particularly in cryptography.
1. Pre-image Resistance: It should be computationally infeasible to retrieve the original input from its
hash. This means that given a hash value hh, finding a message mm such
that h=hash(m)h=hash(m) should be extremely difficult
2. Second Pre-image Resistance: Given an input m1m1 and its hash h1h1, it should be hard to find
another input (m_2
eq m_1) such that hash(m1)=hash(m2)hash(m1)=hash(m2). This feature ensures that no other input can
produce the same hash value, protecting against certain types of attacks
3. Collision Resistance: It should be difficult to find any two distinct inputs that produce the same hash
value. A collision occurs when hash(m1)=hash(m2)hash(m1)=hash(m2) for (m_1
eq m_2). Strong collision resistance is crucial for the integrity of data and digital messages
• Password Storage: Hashing is essential in securely storing passwords. Instead of saving user
passwords in plain text, systems store the hash of the password. During authentication, the entered
password is hashed, and the hash is compared to the stored value. If they match, access is granted
• Digital Signatures: Hashing functions are used to create digital signatures, ensuring the authenticity
and integrity of messages or documents. A hash of the message is created and then encrypted with the
sender's private key, allowing the recipient to verify the signature using the corresponding public key
• Data Integrity Checks: Hash functions help ensure that data has not been altered. By generating
checksums or hash values for files, users can verify that the content remains unchanged during transfer
or storage
Despite their security advantages, hashing functions are not without drawbacks. Some common vulnerabilities
include:
• Collision Attacks: If a hashing function is susceptible to finding collisions (i.e., two different inputs
yield the same output), its reliability is compromised. For example, older hashing algorithms like MD5
and SHA-1 have known vulnerabilities and are no longer recommended for secure applications
• Brute Force Attacks: When a hash is generated from a weak or short password, attackers can use
brute-force methods to guess the original password by trying all possible combinations
Conclusion
Hashing functions play a crucial role in digital security by providing mechanisms for data integrity, password
protection, and authenticity. While advancements in cryptographic hash functions have improved security, it
remains essential to choose robust algorithms and implement proper practices to counter evolving threats.