Complete MODULE 2
Complete MODULE 2
• A useful means of classifying security attacks is in terms of passive attacks and activeattacks.
• A passive attack attempts to learn or make use of information from the system butdoes not
affect system resources.
Passive Attacks: Passive attacks are in the nature of eavesdropping on, or monitoring of,
transmissions. The goal of the opponent is to obtain information that is being transmitted. Passive
attacks are very difficult to detect, because they do not involve any alterationof the data. However, it is
feasible to prevent the success of these attacks, usually bymeans of encryption
Active Attack: Active attacks are a type of cybersecurity attack in which an attacker attempts to alter,
destroy, or disrupt the normal operation of a system or network. Active attacks involve the attacker
taking direct action against the target system or network, and can be more dangerous than passive
attacks.
SECURITY SERVICES:
• Confidentiality: Ensures that the information in a computer system and transmitted information
are accessible only for reading by authorized parties.
• Integrity: Ensures that only authorized parties are able to modify computer system assets and
transmitted information. Modification includes writing, changing status, deleting, creating and
delaying or replaying of transmitted messages.
• Non repudiation: Requires that neither the sender nor the receiver of a message be able to deny
the transmission.
• Availability: Requires that computer system assets be available to authorized parties when
needed.
1) Data Confidentiality: An attacker should not be able to read the transmitted data or extract data in
case of encrypted data. In short, confidentiality is the protection of transmitted data from passive
attacks. One of the best ways to protect data confidentiality is encryption. encryption is a process that
uses an algorithm to turn data into an unreadable format. Only authorised people can decrypt the data
and read it.
CLASSICAL ENCRYPTION TECHNIQUES: There are two basic building blocks of all encryption
techniques: substitution and transposition.
Note that the alphabet is wrapped around, so that letter following “z‟ is “a‟.
For each plaintext letter p, substitute the cipher text letter c such that
C = E(p) = (p+3) mod 26
The table consists of the alphabets written out 26 times in different rows, each alphabet shifted
cyclically to the left compared to the previous alphabet, corresponding to the 26 possible.Caesar
Ciphers
At different points in the encryption process, the cipher uses a different alphabet from one of the
rows.
Example:
Input : Plaintext : GEEKSFORGEEKS
Keyword : AYUSHNon repudiation:
Output : Ciphertext : GCYCZFMLYLEIM
For generating key, the given keyword is repeated in a circular manner until it matches the
length of
the plain text. The keyword "AYUSH" generates the key "AYUSHAYUSHAYU" The plain text
is then encrypted using the process explained below.
• One-time pad cipher
One-time pad cipher is a type of Vignere cipher which includes the following features −
• It is an unbreakable cipher.
• The key is exactly same as the length of message which is encrypted.
• The key is made up of random symbols.
• As the name suggests, key is used one time only and never used again for any other
message to be encrypted.
• Due to this, encrypted message will be vulnerable to attack for a cryptanalyst. The key
used for a one-time pad cipher is called pad, as it is printed on pads of paper.
Why is it Unbreakable?
The key is unbreakable owing to the following features −
◦ The key is as long as the given message.
◦ The key is truly random and specially auto-generated.
◦ Each key should be used once and destroyed by both sender and receiver.
• Playfair cipher: The best known multiple letter encryption cipher is the playfair, which treats
digrams in the plaintext as single units and translates these units into cipher text digrams. The
playfair algorithm is based on the use of 5x5 matrix of letters constructed using a keyword. Let
the keyword be “monarchy”. The matrix is constructed by filling in the letters of the keyword
(minus duplicates) from left to right and from top to bottom, and then filling in the remainder of
the matrix with the remaining letters in alphabetical order. The letter “i‟ and “j‟ count as one
letter.
• Hill cipher : The Hill cipher is a polygraphic substitution cipher based on linear algebra.
developed by the mathematician Lester S. Hill. It was the first polygraphic cipher in which it
was practical to operate on more than three symbols at once.
The relationship between a block of plaintext and its ciphertext is expressed by
Encryption: C = K P mo26
Decryption: P = K-1C mod 26
CONSTRUCTION
Generic cryptographic hash:
APPLICATIONS
Hash-based MAC:
MAC
➢ MAC is used as a message integrity check as well as to provide message
authentication.
➢ It makes use of a common shared secret, k, between two communicating parties.
➢ The hash-based MAC that we now introduce is an alternative to the CBC-MAC.
➢ The cryptographic hash applied on a message creates a digest or digital fingerprint
of that message.Non repudiation:
➢ Suppose that a sender and receiver share a secret, k.
➢ If the message and secret are concatenated and a hash taken on this string, then the hash value
becomes a fingerprint of the combination of the message, m and the secret, k.
➢ MAC = h (m|| k)
➢ The MAC is much more than just a checksum on a message.
➢ It is computed by the sender, appended to the message, and sent across to the receiver.
On receipt of the message + MAC, the receiver performs the computation using the
common secret and the received message.
➢ It checks to see whether the MAC computed by it matches the received MAC.
➢ A change of even a single bit in the message or MAC will result in a mismatch
between the computed MAC and the received MAC.
➢ In the event of a match, the receiver concludes the following:
➢ (a) The sender of the message is the same entity it shares the secret with — thus
the MAC provides source authentication.
➢ (b) The message has not been corrupted or tampered with in transit — thus the
MAC provides verification of message integrity.
➢ Drawbacks:
➢ An attacker might obtain one or more message—MAC pairs in an attempt to
determine the MAC secret.
➢ First, if the hash function is one-way, then it is not feasible for an attacker to deduce
the input to the hash function that generated the MAC and thus recover the secret.
➢ If the hash function is collision-resistant, then it is virtually impossible for an
attacker to suitably modify a message so that the modified message and the original
both map to the same MAC value.
HMAC
➢ There are other ways of computing the hash MAC other than this method using HMAC .
➢ Another possibility is to use key itself as the Initialization Vector (IV) instead of concatenating it
with the message.
➢ Bellare, Canetti, and Krawczyk proposed the HMAC and showed that their scheme is re against a
number of subtle attacks on the simple hash-based MAC.
➢ Figure 7.7 shows how an HMAC is computed given a key and a message. The key is padded with
O's (if necessary) to form a 64-byte string denoted K' and XORed with a constant (denoted IPAD).
➢ It is then concatenated with the message and a hash is performed on the result.
➢ K' is also XORed with another constant (denoted OPAD) after which it is prepended to the output of
the first hash.
➢ Once again hash is then computed to yield the HMAC.
➢ As shown in Fig. 7.7, HMAC performs an extra hash computation but provides
greatly enhanced security.
3) Non repudiation: Non-repudiation is the assurance that someone cannot deny the validity of
something. Non-repudiation is a legal concept that's widely used in information security and refers to a
service, which provides proof of the origin and integrity of data. In other words, non-repudiation makes
it very difficult to successfully deny who/where a message comes from, as well as the authenticity and
integrity of that message. Nonrepudiation is achieved through cryptographic technique like digital
signatures.
Digital Signature: digital signature is a technique that binds a person/entity to the digital data. This
binding can be independently verified by receiver as well as any third party.
Digital signature is a cryptographic value that is calculated from the data and a secret key known only
by the signer. In real world, the receiver of message needs assurance that the message belongs to the
sender and he should not be able to repudiate the origination of that message.
Model of Digital Signature As mentioned earlier, the digital signature scheme is based on public key
cryptography. The model of digital signature scheme is depicted in the following illustration −
The following points explain the entire process in detail
• Each person adopting this scheme has a public-private key pair.
• Generally, the key pairs used for encryption/decryption and signing/verifying are different. The
private key used for signing is referred to as the signature key and the public key as the
verification key.
• Signer feeds data to the hash function and generates hash of data.
• Hash value and signature key are then fed to the signature algorithm which produces the digital
signature on given hash. Signature is appended to the data and then both are sent to the verifier.
• Verifier feeds the digital signature and the verification key into the verification algorithm. The
verification algorithm gives some value as output.
• Verifier also runs same hash function on received data to generate hash value.
• For verification, this hash value and output of verification algorithm are compared. Based on
the comparison result, verifier decides whether the digital signature is valid.
• Since digital signature is created by ‘private’ key of signer and no one else can have this key;
the signer cannot repudiate signing the data in future.
It should be noticed that instead of signing data directly by signing algorithm, usually a hash of
data is created. Since the hash of data is a unique representation of data, it is sufficient to sign
the hash in place of data. The most important reason of using hash instead of data directly for
signing is efficiency of the scheme.
4) Availability: Availability guarantees that systems, applications and data are available to users when
they need them. The most common attack that impacts availability is denial-of-service in which the
attacker interrupts access to information, system, devices or other network resources.
Denial of Service (DoS) is a cyber-attack on an individual Computer or Website with the intent to deny
services to intended users. Their purpose is to disrupt an organization’s network operations by denying
access to its users. Denial of service is typically accomplished by flooding the targeted machine or
resource with surplus requests in an attempt to overload systems and prevent some or all legitimate
requests from being fulfilled. For example, if a bank website can handle 10 people a second by clicking
the Login button, an attacker only has to send 10 fake requests per second to make it so no legitimate
users can log in. DoS attacks exploit various weaknesses in computer network technologies. They may
target servers, network routers, or network communication links. They can cause computers and routers
to crash and links to bog down. The most famous DoS technique is the Ping of Death. The Ping of
Death attack works by generating and sending special network messages that cause problems for
systems that receive them. In the early days of the Web, this attack could cause unprotected Internet
servers to crash quickly.
Network Segmentation: egmenting the network can help prevent a DoS attack from spreading
throughout the entire network. This limits the impact of an attack and helps to isolate the affected
systems.
Implement Firewalls: Firewalls can help prevent DoS attacks by blocking traffic from known
malicious IP addresses or by limiting the amount of traffic allowed from a single source.
Use Intrusion Detection and Prevention Systems: Intrusion Detection and Prevention Systems
(IDS/IPS) can help to detect and block DoS attacks by analyzing network traffic and blocking
malicious traffic.
Limit Bandwidth: Implementing bandwidth limitations on incoming traffic can help prevent a DoS
attack from overwhelming the network or server.
Implement Content Delivery Network (CDN): CDN can help to distribute traffic and reduce the
impact of a DoS attack by distributing the load across multiple servers.
Use Anti-Malware Software:Anti-malware software can help to detect and prevent malware from
being used in a DoS attack, such as botnets.
Perform Regular Network Scans:Regular network scans can help identify vulnerabilities and
misconfigurations that can be exploited in a DoS attack. Patching these vulnerabilities can prevent a
DoS attack from being successful.
5. privacy: Data privacy, also called information privacy, is an aspect of data protection that addresses
the proper storage, access, retention, immutability and security of sensitive data.
Data privacy is typically associated with the proper handling of personal data or personally identifiable
information (PII), such as names, addresses, Social Security numbers and credit card numbers.
However, the idea also extends to other valuable or confidential data, including financial data,
intellectual property and personal health information.