Is Slides
Is Slides
Rivest-Shamir-Adleman (RSA)-Algorithm
• The pioneering paper by Diffie and Hellman [DIFF76b] introduced a new approach to cryptography and, in
effect, challenged cryptologists to come up with a cryptographic algorithm that met the requirements for
public-key systems.
• Challenge was developed in 1977 by Rivest, Adi Shamir, and Len Adleman at MIT and first published in
1978 [RIVE78].
• The RSA scheme is a cipher in which the plaintext and ciphertext are integers between 0 and n - 1 for
some n.
• A typical size for n is 1024 bits, or 309 decimal digits.
• RSA makes use of an expression with exponentials.
• Plaintext is encrypted in blocks, with each block having a binary value less than some number n.
• That is, the block size must be less than or equal to log2(n) + 1; in practice, the block size is i bits, where
This means that aa and bb leave the same remainder when divided by mm.
For example:
plain text
Homework
Digital Signatures
4. Emails
RSA can be used to digitally sign emails, ensuring their authenticity and preventing tampering
5. RSA can be used to digitally sign documents, ensuring their integrity and non-repudiation
S = 93a7b6a821c3d93f41e6b382b2f9abec27e8f6f587efcf3a82ab93c9bcf1da56
Digital Signature
At Receiver side (Alice)
QUEST Nawabshah S = 93a7b6a821c3d93f41e6b382b2f9abec27e8f6f587efcf3a82ab93c9bcf1da56
Message Digital Signature
e3cf177203db3c5d28d44d4b1079d1c6df1e67a8df0c7d96ab7c7dcf8d395ae3
Hash
Decryption (Using Bob’s Public key) 25
Digital signatures-Example
Decrypt(S, Bob's public key)
e3cf177203db3c5d28d44d4b1079d1c6df1e67a8df0c7d96ab7c7dcf8d395ae3
After Decryption
Compare both Hashes
e3cf177203db3c5d28d44d4b1079d1c6df1e67a8df0c7d96ab7c7dcf8d395ae3
=
e3cf177203db3c5d28d44d4b1079d1c6df1e67a8df0c7d96ab7c7dcf8d395ae3
In situations where there is not complete trust between sender and receiver, something more
than authentication is needed. The most attractive solution to this problem is the digital
signature.
Muhammad Umar (Department of Cybersecurity) 28
Digital signatures-Properties
Digital signature must have the following properties:
It must verify the author and the date and time of the signature.
Padding
• Let message is M, divide the M message into the chunks M(m1,m2,m3…..)
• Each chunks size should be 512 bits
• The input message is divided into 512-bit blocks.
1. A '1' bit is appended to the message.
2. '0' bits are added until the length of the message (in bits) modulo 512 is 448.
3. The original message length (in bits) is appended as a 64-bit big-endian integer, filling up
the remaining 64 bits.
Muhammad Umar (Department of Cybersecurity) 32
Secure Hash Algorithm (SHA-1)-Padding
• In SHA-1 original length of the message in the padded message. This is done by
representing the original message length in binary as a 64-bit integer and appending it to
the end of the message.
• Let original message QUEST NAWABSHAH its length is (120 bits).
• Binary representation of 120 is
0000000000000000000000000000000000000000000000000000000001111000
STEP 1: Append 1 bit
• Append a '1' bit to the end of the message.
• Original Message: “QUEST Nawabshah1”
STEP 2: Add '0' bits:
• Add '0' bits until the length of the message (in bits) modulo 512 is 448.
• In this case, add 448 - (120+1) = 327 '0' bits.
Updated Message: “QUEST NAWAMuBhaSmHmaAdUHm”ar1(De0pa0rtm0e.n.t.o0fC0yb0er"sec(u3rit2y)7 zeros added) 25
Secure Hash Algorithm (SHA-1)-Padding
STEP 3 Append Message Length (64 bits):
Updated Message: “QUEST NAWABSHAH1 000...000 000...000001111000" (64 bits added)
160 bit
W0
512 bit MSA R0
16 words Each word of 32 bit
W1
R1
W2
R2 Wt=Wt-16 ⊕ Wt-14 ⊕Wt-8 ⊕Wt-3
W3
R79
A B C D E
f +
<<5 +
Wt
<<30 +
Kt
+
A B C D E
• (B 𝖠 C) ∨ ((¬B) 𝖠 D)
• B⊕C⊕D
• (B 𝖠 C) ∨ (B 𝖠 D) ∨ (C 𝖠 D)
• B⊕C⊕D
filtering CONS
& Cons packet filters filter on TCP header information, all fragments after the
first fragment are passed unconditionally. Decisions to use packet filters
assume that the filter of the first fragment accurately enforces the
policy.
• Packet filters use complex ACLs, which can be difficult to implement and
maintain.
• Packet filters cannot dynamically filter certain services. For example,
sessions that use dynamic port negotiations are difficult to filter without
opening access to a whole range of ports.
56
Stateful filtering Firewalls
• Records all connections passing through and determines
whether a packet is the start of a new connection, a part of an
existing connection or not part of any connection.
• Static rules are still used, these rules can now contain
connection state as one of their criteria.
• Some DOS attacks bombard the firewall with thousands of fake
connection packets trying to overwhelm the firewall by filling
its connection state memory.
• Stateful firewalls are the most versatile and the most common
firewall technologies in use. Stateful firewalls provide stateful
packet filtering by using connection information maintained in
a state table. Stateful filtering is a firewall architecture that is
classified at the network layer. It also analyzes traffic at OSI
Layer 4 and Layer 5.