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

CS unit 1

The document provides an overview of Cyber Security and Digital Forensics, focusing on information security, cryptography, and cyber crime. It discusses the importance of protecting sensitive information, mitigating risks, and ensuring compliance with regulations, while introducing key concepts such as the CIA triad (Confidentiality, Integrity, Availability) and various cryptographic techniques. Additionally, it outlines security mechanisms, services, and types of attacks that can threaten information security.

Uploaded by

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

CS unit 1

The document provides an overview of Cyber Security and Digital Forensics, focusing on information security, cryptography, and cyber crime. It discusses the importance of protecting sensitive information, mitigating risks, and ensuring compliance with regulations, while introducing key concepts such as the CIA triad (Confidentiality, Integrity, Availability) and various cryptographic techniques. Additionally, it outlines security mechanisms, services, and types of attacks that can threaten information security.

Uploaded by

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

Cyber Security and Digital Forensics

H.S.Mistry

Unit - 1 Unit - 2 Unit – 3


Introduction of Information Network and system Cyber crime
Security and cryptography. Security.
Unit – 1 Introduction of Information Security and
Cryptography

1.1 1.2 1.3 1.4 1.5

Basic concept CIA traid OSI Security Private and Message


of information Architecture ( public key Digest 5
Security. Security Servic cryptography. Hashing &
Mecha-nisms
SHA.
and attacks).
1.1 Introduction : Basic Concepts of Information
Security

As we know , due to Increase in hardware


technology speed and internet speed, it became
growing very rapidly in different domains like
autonomous systems, E-commerce, Gaming,
Natural Resource Management, Education ,
Space Exploration , Agriculture, Energy
Management, Healthcare, finance ETC…

In this increasingly globalized digital economy ,


information assest are critical to existence of
some organizations as well as to any business. It
unacceptable for information to leak,
Confidential information about company’s
customers, their personal information, finances
or new product line that is obtained by a rival
may result in lost revenue , legal actions or even
the company’s demise.
1.1.1 Why Information Security?
• We use information security to protect valuable information assets from a wide range of
threats, including theft and cybercrime. Here are some key reasons why information
security is important:
• Protecting sensitive information: Information security helps protect sensitive information
from being accessed, disclosed, or modified by unauthorized individuals. This includes
personal information, financial data, and trade secrets, as well as confidential government
and military information.
• Mitigating risk: By implementing information security measures, organizations can
mitigate the risks associated with cyber threats and other security incidents. This includes
minimizing the risk of data breaches, denial-of-service attacks, and other malicious
activities.
• Compliance with regulations: Many industries and jurisdictions have specific regulations
governing the protection of sensitive information. Information security measures help
ensure compliance with these regulations, reducing the risk of fines and legal liability.
• Protecting reputation: Security breaches can damage an organization’s reputation and
lead to lost business. Effective information security can help protect an organization’s
reputation by minimizing the risk of security incidents.
• Ensuring business continuity: Information security helps ensure that critical business
functions can continue even in the event of a security incident. This includes maintaining
1.1.2 What is Information Security?
• Information Security is not only about securing information from unauthorized
access. Information Security is basically the practice of preventing unauthorized
access, use, disclosure, disruption, modification, inspection, recording, or
destruction of information. Information can be a physical or electronic one.
Information can be anything like Your details or we can say your profile on social
media, your data on your mobile phone, your biometrics, etc. Thus Information
Security spans so many research areas like Cryptography, Mobile Computing,
Cyber Forensics, Online Social Media, etc.
• “The practice of protecting sensitive data, Systems, networks, and information
assets from unauthorized access, disclosure, alteration , destruction, or any
form of cyber threat.”
1.2 CIA TRAID
Confidentiality
• Confidentiality means that only authorized individuals/systems can
view sensitive or classified information. The data being sent over the
network should not be accessed by unauthorized individuals. The
attacker may try to capture the data using different tools available on
the Internet and gain access to your information. A primary way to
avoid this is to use encryption techniques to safeguard your data so
that even if the attacker gains access to your data, he/she will not be
able to decrypt it. Encryption standards include AES(Advanced
Encryption Standard) and DES (Data Encryption Standard). Another
way to protect your data is through a VPN tunnel. VPN stands for
Virtual Private Network and helps the data to move securely over the
network.
Integrity

• Well, the idea here is to make sure that data has not been
modified. Corruption of data is a failure to maintain data
integrity. To check if our data has been modified or not, we make
use of a hash function.
We have two common types: SHA (Secure Hash Algorithm) and
MD5(Message Direct 5). Now MD5 is a 128-bit hash and SHA is a
160-bit hash if we’re using SHA-1. There are also other SHA
methods that we could use like SHA-0, SHA-2, and SHA-3.
Availability

• This means that the network should be readily available to its users.
This applies to systems and to data. To ensure availability, the network
administrator should maintain hardware, make regular upgrades,
have a plan for fail-over, and prevent bottlenecks in a network.
Attacks such as DoS or DDoS may render a network unavailable as the
resources of the network get exhausted. The impact may be
significant to the companies and users who rely on the network as a
business tool. Thus, proper measures should be taken to prevent such
attacks.
1.3 OSI SECURITY ARCHITECTURE
• The International Telecommunication Union (ITU) recommends the
Open System Interconnection (OSI) Security architecture , which
outlines a methodical way to specify security needs and method to
satisfy those criteria.
• The OSI security architecture provides a general description of
security services, security mechanisms, as well as a description of
security attacks
1.3.1 Security Attacks
• Attack: An assault on system security that devices from an intelligent
threat; that is , an intelligent act that is deliberate attempt to evade
security services and violate the security policy of a system
• A security attack is an activity or act made upon a system with the
goal to obtain unauthorized access to information or resources. It is
usually carried out by evading security policies that are in place in
organizations or individuals devices.
• Security attacks can be classified into two categories:
• Active attack
• Passive attack
• Threat: A potential for violation of security, which exist when there is
a circumstances, capability, actions, or event that could breach
security and cause harm.
1.3.2 Security Mechanism
• A security mechanism is a method or technology that protects data
and systems from unauthorized access, attacks, and other threats.
Security measures provide data integrity, confidentiality, and
availability, thereby protecting sensitive information and maintaining
trust in digital transactions. In this article, we will see types of security
mechanisms.
1.3.3 Security Services:
• “ A processing or communication services that is provided by a system
to give a specific kind of protection to system resources”
• The OSI security architecture classifies security services as follow:
• Authentication
• Access control services
• Data confidentiality
• Data integrity
• Non-repudiation
1.4 CRYPTOGRAPHY AND CRYPTOGRAPHIC
TECHNIQUES
• 1.4.1 Basic cryptographic terms:
• Cryptography: “ Cryptography is the art of archiving security by
encoding message to make them non-readable”
• Cryptanalysis: “ Cryptanalysis is the technique of decoding messages
from a non-readable format without knowing how they were initially
converted from readable format to non readable format.”
• Cryptology: “Cryptology is a combination of cryptography and
cryptanalysis.”
Cryptography + Cryptanalysis = Cryptology
• Plaintext or Clear text : “Any original message that can be readable and
understand by the sender , the recipient, and also by anyone else who
gets access to that message.”
• Cipher Text: “ When an original plain-text message is codified using any
suitable scheme into the form which is not understandable by other
then the sender and the recipient, then such resulting message is called
cipher text.”
• Encryption : “The process of encoding plain text message into cipher
text message is called encryption”
• Decryption: “The reverse process of transforming cipher text message
back to plain text message is called decryption.”
1.4.2 Cryptographic techniques
[A] Substitution Techniques
• Caesar Cipher
• Monoalphabetic Cipher
• Polyalphabetic Cipher
• Playfair Cipher
• Hill Cipher
• One-time Pad
Caser Cipher
• The Caesar cipher is a simple encryption technique that was used by
Julius Caesar to send secret messages to his allies. It works by shifting
the letters in the plaintext message by a certain number of positions,
known as the “shift” or “key”. The Caesar Cipher technique is one of
the earliest and simplest methods of encryption techniques.
• It’s simply a type of substitution cipher, i.e., each letter of a given text
is replaced by a letter with a fixed number of positions down the
alphabet. For example with a shift of 1, A would be replaced by B, B
would become C, and so on. The method is apparently named after
Julius Caesar, who apparently used it to communicate with his
officials.
• For example, if the shift is 3, then the letter A would be replaced by
the letter D, B would become E, C would become F, and so on. The
alphabet is wrapped around so that after Z, it starts back at A.
• Here is an example of how to use the Caesar cipher to encrypt the
message “HELLO” with a shift of 3:
• Write down the plaintext message: HELLO
• Choose a shift value. In this case, we will use a shift of 3.
• Replace each letter in the plaintext message with the letter that is
three positions to the right in the alphabet.
• H becomes K (shift 3 from H)
E becomes H (shift 3 from E)
L becomes O (shift 3 from L)
L becomes O (shift 3 from L)
O becomes R (shift 3 from O)
• 4.The encrypted message is now “KHOOR”.
Monoalphabetic Cipher
• A monoalphabetic cipher is a substitution cipher where each letter in
the plaintext is replaced by another letter in the ciphertext. In this
cipher, each letter is consistently replaced by the same corresponding
letter across the entire message.
• The key is simply a mapping of the letters in the alphabet to other
letters. This mapping can be random or follow any fixed rule. The key
remains the same for the entire message.
• Steps for Encryption (Using Monoalphabetic Cipher):
• Choose a key: This key is the mapping of each letter in the alphabet to
another letter. The mapping can be random.
• Encrypt the message: Each letter in the plaintext is replaced by its
corresponding letter from the key.
• Example:
• Step 1: Create a key for substitution.
• Let’s create a simple substitution key where we randomly map letters
to other letters:
• Plaintext alphabet: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
• Ciphertext alphabet: D M S E L G Q T R V X A Z H B U I F P W Y J K C O
N
• Here, we will replace:
• A→D
• B→M
• C→S
• D→E
• E→L
• F→G
• G→Q
• H→T
• I→R
• J→V
• K→X
• L→A
• M→Z
• N→H
• O→B
• P→U
• Q→I
• R→F
•S→P
•T→W
• U→Y
• V→J
• W→K
• X→C
•Y→O
• Z→N
• Step 2: Encrypt a message.
• Let’s encrypt the message "HELLO".
•H→T
•E→L
•L→A
•L→A
•O→B
• So, the encrypted message is: "TLAAB".
• Step 3: Decrypting the message.
• To decrypt, you simply reverse the substitution by using the same key.
The receiver will replace each letter in the ciphertext with the
corresponding letter from the plaintext alphabet.
• T→H
•L→E
•A→L
•A→L
•B→O
Difference between ceasar cipher
and monoalphabetic cipher
• Caesar Cipher:
• Shift-based: Each letter in the plaintext is shifted by a fixed number of
positions in the alphabet. For example, with a shift of 3:
• A→D
• B→E
• C→F
• and so on.
• If the shift is 3, the word "HELLO" becomes "KHOOR."
• The key in a Caesar cipher is always a number (the shift).
• Monoalphabetic Cipher:
• Substitution-based: Each letter in the plaintext is replaced with a
specific letter in the ciphertext. The mapping can be random, and it's
not necessarily a shift.
• For example, A → P, B → M, C → Z, etc. This mapping is fixed but can be
different from a Caesar cipher.
• The key in a monoalphabetic cipher is the specific letter mapping
(which could be anything, not just a shift).
• In summary:
• Caesar cipher is a type of monoalphabetic cipher with a fixed shift.
• Monoalphabetic cipher allows for any kind of letter substitution, not
just shifting.
Polyalphabetic Cipher
• A polyalphabetic cipher is a type of substitution cipher where each
letter in the plaintext is replaced by a letter from a different alphabet,
based on a key. The key determines how much to shift each letter, and
it repeats to cover the entire message. This makes it harder to break
than the monoalphabetic cipher, where each letter is replaced by the
same letter.
• Example (Vigenère Cipher):
• Message: "HELLO"
Key: "KEY" (repeated as needed)
• Step 1: Write the plaintext and key, repeating the key to match the
length of the message.

• Plaintext: H E L L O
• Key: K E Y K E
• Step 2: Encrypt each letter based on the key.
• H (shift by K = 10) → R
• E (shift by E = 4) → I
• L (shift by Y = 24) → J
• L (shift by K = 10) → V
• O (shift by E = 4) → S
• Ciphertext: "RIJVS“
• n a polyalphabetic cipher like the Vigenère cipher, each letter in the
plaintext is encrypted using a shifting pattern determined by the key,
making it more secure than monoalphabetic ciphers.
• H (7) with K (10): Shift H (7) by 10 → R (17)
• E (4) with E (4): Shift E (4) by 4 → I (8)
• L (11) with Y (24): Shift L (11) by 24 → J (9) (Since 11 + 24 = 35, and 35
mod 26 = 9)
• L (11) with K (10): Shift L (11) by 10 → V (21)
• O (14) with E (4): Shift O (14) by 4 → S (18)
• When we say "a mod b", we're asking for the remainder when a is
divided by b.
• For example, 35 mod 26 means "what is the remainder when 35 is
divided by 26?"
• 35 divided by 26 gives a quotient of 1 (because 26 fits into 35 once)
and a remainder of 9.
• So, 35 mod 26 = 9.
Playfair Cipher
• The Playfair Cipher is a classical encryption technique used for
encrypting messages. It is a substitution cipher based on a 5x5 grid of
letters.
• Rules of the Playfair Cipher:
• Create a Key Square:
• Use a keyword to fill a 5x5 grid with unique letters.
• Omit the letter 'J' (combine it with 'I').
• Fill remaining spaces with other letters of the alphabet.
• Divide the Plaintext into Digraphs:
• Split the plaintext into pairs of two letters (e.g., "HELLO" → "HE", "LL", "O").
• If a pair has two identical letters (e.g., "LL"), insert a filler (e.g., "X") between
them.
• If the plaintext has an odd length, add a filler (e.g., "X") at the end.
• Encryption Rules:
• For each pair of letters:
• Same Row: Replace each letter with the letter to its right (wrap to the beginning if at the
end).
• Same Column: Replace each letter with the letter below it (wrap to the top if at the
bottom).
• Rectangle Rule: Replace each letter with the one in the same row but in the column of the
other letter.
• Decryption:
• Reverse the encryption process:
• Same row: Move left.
• Same column: Move up.
• Rectangle rule: Use the opposite corners.
• Example:
• Key: "MONARCHY“
• Plaintext: "HELLO"
• Create the 5x5 grid (omit 'J')
• Divide into digraphs: "HE", "LX", "LO"
(Add filler "X" between duplicate "L" and at the end if needed.)
• Encrypt each digraph:
• HE: H and E form a rectangle → replace with "C" and "F".
• LX: L and X are in the same row → replace with “S" and "U".
• LO: L and O form a rectangle → replace with “P" and “M".
• Ciphertext: "CFSUPM"
• Same Row: Replace each letter with the letter to its right (wrap
around if needed).
• Same Column: Replace each letter with the letter below it (wrap
around if needed).
• Rectangle Rule: Replace with the opposite corners of the rectangle.
[B] Transposition techniques
• The transposition technique is a kind of encryption that works by
performing permutation on the given plaintext. Transposition ciphers
are created by using the transposition technique to map normal text
into ciphertext.
• This chapter will cover multiple uses of the transposition technique as
well as the variations between transposition and the substitution
technique.
• On the other hand, the substitution approach substitutes a symbol in
plaintext with a symbol in ciphertext. However, the transposition
method generates the ciphertext by applying permutation to the
original plaintext.
• Rail Fence Transposition
• Columnar Transposition
• Columnar Transposition - Multiple Rounds
• Book Cipher/Running Key Cipher
• Vernam Cipher
Rail Fence Transposition
• Rail-Fence is a basic Transposition method in which plaintext is
written as a series of diagonals, which is then read row by row to
generate the ciphertext.
Plaintext: Let us meet Today
We will now write this simple sentence in a diagonal
format, as you can see below, following a specific
order −
• Ciphertext: LTSETOAEUMETDY
• The rail fence cipher is simple to use and even simpler to break for a
cryptanalyst. Thus, a more complex method is required.
Columnar Transposition
• In comparison to the rail fence, the columnar transposition cipher is
more complex. To get ciphertext using this method, use these steps −

• Plain text: Let us meet Today


• Place the plaintext in a predefined−size rectangle. In our case, the
rectangle's defined size is 3x5. The image below shows plaintext
placed in a 3x5 rectangle. Also, we permuted the column order.
• Ciphertext: LUETAESEOYEMTD
• Similar to the rail fence cipher, the columnar cipher can be easily
broken. The cryptanalyst just needs to test a few permutations and
combinations of the column order to obtain the permuted column
order resulting in the original message. As a result, a more
complicated method had to be used to secure the encryption.
Columnar Transposition - Multiple Rounds/
Improved Columnar Transposition
• It is same as the simple columnar method but offers an improvement.
This columnar method is applied to the plaintext more than once. The
steps for using the columnar approach with multiple rounds are as
follows −
• Ciphertext: LUETAESEOYEMTD
• To decipher the ciphertext for round 2, arrange the first round's
ciphertext in a 3x5 rectangle and rearrange the columns. The
extracted ciphertext for round 2 is LSYETMOATTEMUD. In this
method, we can execute as many iterations as needed. Increasing the
number of repetitions increases the complexity.
Book Cipher/Running Key Cipher
• The book cipher, also known as the running key cipher, operates on
the same basic principles as the one-time pad cipher. In onetime pad
cipher, the key has the same length as the plaintext and is deleted
after use. Every time a new key is used to send a new message.
• The key or onetime pad is extracted from the book, which is an
improvement over the onetime pad in Book Cipher. Let us outline the
various stages −
• Plain text: Meet tomorrow.
• The key is from the book: ANENCRYPTION.
• Now we have to turn this plaintext and key text into numeric form
and combine them to get ciphertext, as seen in the image below −
• Add the numeric form of plaintext and key text. So after adding both
the values we will get 12 7 8 32 21 31 36 29 36 25 28 35 −
• Now we have some numbers in the above outcome (shown in bold)
which is greater that 26 so we will subtract these number with 26 and
then the final outcome will be − 12 17 8 6 21 5 10 3 10 25 3 9
• So the new ciphertext will be: MRIGVFKDKZDJ.
Vernam Cipher
• A one-time pad is a subset of the Vernam cipher that uses a random
set of nonrepeating characters as its input ciphertext. The ciphertext
used for transposition is never utilised for another message after it
has been used. The input ciphertext's length needs to match the plain
text's length.
For Example: The plaintext message is point and
ciphertext is ntcba
1.4.3 Private and public key cryptography
• Encryption is the process of converting the original message called
plain text into unintelligible message called cipher text by sender . For
such conversion sender uses two important components namely an
algorithm and the key. Cryptography can be classified into two
categories .
1. Symmetric Key Cryptography
• It is an encryption system where the sender and receiver of a
message use a single common key to encrypt and decrypt messages.
Symmetric Key cryptography is faster and simpler but the problem is
that the sender and receiver have to somehow exchange keys
securely. The most popular symmetric key cryptography systems are
Data Encryption Systems (DES) and
Advanced Encryption Systems (AES) .
2. Asymmetric Key Cryptography
• In Asymmetric Key Cryptography, a pair of keys is used to encrypt and
decrypt information. A sender’s public key is used for encryption and
a receiver’s private key is used for decryption. Public keys and Private
keys are different. Even if the public key is known by everyone the
intended receiver can only decode it because he alone knows his
private key. The most popular asymmetric key cryptography algorithm
is the RSA algorithm.
1.5 MESSAGE DIGESTING , HASHING
AND SHA
• 1.5.1 Hashing
• A Hash Function (H) takes a variable-length block of data and returns a hash value of a
fixed size. A good hash function has a property that when it is applied to a large number of
inputs, the outputs will be evenly distributed and appear random. Generally, the primary
purpose of a hash function is to maintain data integrity. Any change to any bits or bits in
the results will result in a change in the hash code, with a high probability.
• The type of hash function that is needed for security purposes is called a cryptographic
hash function.
• A cryptographic hash function (or cryptographic hash algorithm) is an algorithm that is not
computationally efficient (no attack is more efficient than brute force) when it is used to
find either:
• A data object which maps to a predefined hash result
• Two data objects that map to the hash result in collision-free property.
• Working on Hashing Algorithms in Cryptography
• The first act of the hashing algorithm is to divide the large input data into blocks of equal
size. Further, the algorithm applies the hashing process to the data blocks one by one.
• Though one block is hashed separately, all the blocks are related to each other. The
output hash value for the first data block is taken as an input value and is summed up
with the second data block. Similarly, the hashed output of the second block is summed
up with the third block, and the summed-up input value is again hashed. And this
process goes on and on until you get the final hash output, which is the summed-up
value of all the blocks that were involved.
• Therefore, tampering with the data of any block will change its hash value. As its hash
value goes into the feeding of blocks following it, all the hash values are changed. This is
how even the smallest change in the input data is detectable, as it changes the entire
hash value
• Alice is a vendor whose business supplies stationery to Bob's office on credit. She sends Bob an
invoice with an inventory list, billing amount, and her bank account details a month later. She
applies her digital signature to the document and hashes it before sending it to Bob. However,
Todd, who's a hacker, intercepts the document while it's in transit and replaces Alice's bank
account details with his.
• When Bob receives the letter, his computer calculates the hash value of the document and finds
that it's different from the original hash value. Bob's computer immediately raises a flag, warning
him that something is fishy with the document and he shouldn't trust it.
• Without the hashed document, Bob would easily have trusted the content of the document
because he was acquainted with Alice and the transaction details in the document were genuine.
However, since the hash values did not match, Bob was aware of the change. Now, he contacts
Alice by phone and shares with her the information in the document he received. Alice confirms
that her bank account is different than what is written in the document.
• That's how a hashing function saves Alice and Bob from financial fraud. Now imagine this scenario
with your own business and how it could.
• Applications of Hashing
• Hashing provides constant time search, insert and delete operations on average.
This is why hashing is one of the most used data structure, example problems
are, distinct elements, counting frequencies of items, finding duplicates, etc.
• Database indexing: Hashing is used to index and retrieve data efficiently in
databases and other data storage systems.
• Dictionaries : To implement a dictionary so that we can quickly search a word
• Password storage: Hashing is used to store passwords securely by applying a
hash function to the password and storing the hashed result, rather than the
plain text password.
• Network Routing: Determining the best path for data packets
• Bloom Filters : Bloom filter is a space optimized and probabilistic version of
hashing and has huge applications like spam filtering, recommendations.
• Cryptography: Hashing is used in cryptography to generate digital signatures,
message authentication codes (MACs), and key derivation functions.
• Load balancing: Hashing is used in load-balancing algorithms, such as
consistent hashing, to distribute requests to servers in a network.
• Blockchain: Hashing is used in blockchain technology, such as the proof-of-
work algorithm, to secure the integrity and consensus of the blockchain.
• Image processing: Hashing is used in image processing applications, such as
perceptual hashing, to detect and prevent image duplicates and
modifications.
1.5.2 Cryptographic Hashing
Algorithm
• Hashing functions are generally used for data integrity and
authentication of sender. Data integrity assures that the message
received at received receiver side is exactly same as sent by sender.
• Authentication is archived through digital signature. Some of the
important hashing algorithms are :
• Message Digest (MD5)
• Secured Hashing Algorithm(SHA)
• Cyclic Redundancy Check (CRC)
Message Digest 5 (MD5)
• MD5 is a specific message digest algorithm, a type of cryptographic hash function. It
takes an input of any length (a message) and produces a fixed-length (128-bit) hash
value, which acts like a unique fingerprint for the message.
• MD5 was widely used from the early 1990s onwards for various purposes, including:
• File Check: Making sure a file got from the web was not changed while transferring.
MD5 was used to make a code for the first file and compare it to the code of the
received file.
• Password Storage: MD5 was sometimes used to store passwords on servers.
However, it was never recommended to store passwords directly in plain text.
Instead, the password was hashed using MD5, and the hash value was stored. This
meant that even if a security breach occurred, the actual passwords wouldn't be
compromised.
Secure Hash Function (SHA)
• SHA stands for Safe Hash Algorithm. It's a group of codes for keeping data
safe made by NIST. These codes convert any size input into a fixed code,
called a hash value or message digest.
• There are different SHA types, each with varied lengths and security features:
• SHA-1: The first SHA code, making a 160-bit hash. It's now unsafe because of
flaws and is no longer used.
• SHA-2: A family of improved SHA algorithms with various output lengths:
• SHA-224 (224 bits)
• SHA-256 (256 bits - most common)
• SHA-384 (384 bits)
• SHA-512 (512 bits
• SHA-3: A completely redesigned hash function introduced after weaknesses
were found in SHA-2. It offers improved security but isn't as widely used yet.
• SHAs have a number of applications in digital security:
• Data Integrity: Checking if data is changed. Even small change means different
hash value.
• E-Signatures: Verify documents. It uses private key, hash to sign data. Receiver
checks signature using sender's public key, re-computed hash.
• Password Protection: Passwords are encrypted before saved. If there's a breach,
only hash is compromised, not passwords.
• Software Check: Verify downloaded file is unchanged. Often, hash is given by
distributor to check file's authenticity.
RSA algorithm
• RSA(Rivest-Shamir-Adleman) Algorithm is an asymmetric or public-key
cryptography algorithm which means it works on two different keys: Public
Key and Private Key. The Public Key is used for encryption and is known to
everyone, while the Private Key is used for decryption and must be kept
secret by the receiver. RSA Algorithm is named after Ron Rivest, Adi Shamir
and Leonard Adleman, who published the algorithm in 1977.
• Example of Asymmetric Cryptography:
• If Person A wants to send a message securely to Person B:
• Person A encrypts the message using Person B’s Public Key.
• Person B decrypts the message using their Private Key.
• RSA Algorithm is based on factorization of large number and modular
arithmetic for encrypting and decrypting data. It consists of three
main stages:
• Key Generation: Creating Public and Private Keys
• Encryption: Sender encrypts the data using Public Key to get cipher
text.
• Decryption: Decrypting the cipher text using Private Key to get the
original data.
• Select two large prime numbers, p and q.
• Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption.
• Choose a number e less than n, such that n is relatively prime to (p - 1) x (q -1). It means that e and (p - 1) x (q -
1) have no common factor except 1. Choose "e" such that 1<e < φ (n), e is prime to φ (n),
gcd (e,d(n)) =1
• If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using public key <e, n>. To find
ciphertext from the plain text following formula is used to get ciphertext C.
C = me mod n
Here, m must be less than n. A larger message (>n) is treated as a concatenation of messages, each of which is
encrypted separately.
• To determine the private key, we use the following formula to calculate the d such that:
De mod {(p - 1) x (q - 1)} = 1
Or
De mod φ (n) = 1
• The private key is <d, n>. A ciphertext message c is decrypted using private key <d, n>. To calculate plain
text m from the ciphertext c following formula is used to get plain text m.
m = cd mod n
• Example 1:
• This example shows how we can encrypt plaintext 9 using the RSA
public-key encryption algorithm. This example uses prime numbers 7
and 11 to generate the public and private keys.
• Explanation:
• Step 1: Select two large prime numbers, p, and q.
• p=7
• q = 11
• Step 2: Multiply these numbers to find n = p x q, where n is called the
modulus for encryption and decryption.
• First, we calculate
• n=pxq
• n = 7 x 11
• n = 77
• Step 3: Choose a number e less that n, such that n is relatively prime to (p - 1) x
(q -1). It means that e and (p - 1) x (q - 1) have no common factor except 1.
Choose "e" such that 1<e < φ (n), e is prime to φ (n), gcd (e, d (n)) =1.
• Second, we calculate
• φ (n) = (p - 1) x (q-1)
• φ (n) = (7 - 1) x (11 - 1)
• φ (n) = 6 x 10
• φ (n) = 60
• Let us now choose relative prime e of 60 as 7.

Thus the public key is <e, n> = (7, 77)
• Step 4: A plaintext message m is encrypted using public key <e, n>. To
find ciphertext from the plain text following formula is used to get
ciphertext C.
• To find ciphertext from the plain text following formula is used to get
ciphertext C.
• C = me mod n
• C = 97 mod 77
• C = 37
• Step 5: The private key is <d, n>. To determine the private key, we use the following
formula d such that:
• De mod {(p - 1) x (q - 1)} = 1
• 7d mod 60 = 1, which gives d = 43
• The private key is <d, n> = (43, 77)
• Step 6: A ciphertext message c is decrypted using private key <d, n>. To calculate
plain text m from the ciphertext c following formula is used to get plain text m.
• m = cd mod n
• m = 3743 mod 77
• m=9
• In this example, Plain text = 9 and the ciphertext = 37
• Example 2:
• In an RSA cryptosystem, a particular A uses two prime numbers, 13
and 17, to generate the public and private keys. If the public of A is
35. Then the private key of A is ……………?.
• HomeWork

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