Cryptography and Network Security - Module - 1
Cryptography and Network Security - Module - 1
Cryptography and Network Security - Module - 1
Network Security
(15TE71)
Text Books:
➢ Text-1: “Cryptography and Network Security Principles and
Practice” - William Stallings, 6th Edition, Pearson Education Inc.
➢ Text-2: “Applied Cryptography Protocols, Algorithms, and Source
code in C” - Bruce Schneier, 2nd Edition, Wiley Publications
Cryptography
• Cryptography or Cryptology - The practice and study of
techniques for secure communication in the presence of
third parties.
• It is about constructing and analyzing protocols that
prevent third parties or the public from reading private
messages
Security
• What is security?
• Freedom from risk or danger; safety
• Freedom from doubt, anxiety, or fear; confidence
• Something that gives or assures safety, as
• A group or department of private guards – To prevent if visitor
acts as suspicious
• Measures adopted by a government to prevent attack.
• Why do we need security?
• Protect vital information while still allowing access to
those who need it
• Provide authentication and access control for resources
Security
• Who is vulnerable?
• Financial institutions and banks
• Internet service providers
• Pharmaceutical companies
• Government and defense agencies
• Contractors to various government agencies
• Multinational corporations
• ANYONE ON THE NETWORK
• Common security attacks and their countermeasures
• Finding a way into the network – Firewalls
• Exploiting software bugs, buffer overflows – Intrusion Detection
System (IDS)
• Denial of Service – Filtering, IDS
• Packet sniffing - Encryption
Network Security
• Measures are needed to protect data during their
transmission.
• All business, government, and academic organizations
interconnect their data processing equipment with a
collection of interconnected networks.
• Such a collection is often referred to as an internet and the
term internet security is used.
• Examples of Security violations
• User A transmits a file to user B. The file contains sensitive
information (e.g. payroll records) that is to be protected from
disclosure. User C, who is not authorized to read the file, is
able to monitor the transmission and capture a copy of the
file during its transmission.
Network Security
• Security attack:
• Any action that compromises the security of information owned by an
organization.
• Security mechanism:
• A process that is designed to detect, prevent, or recover from a security
attack.
• Security service:
• A processing or communication service that enhances the security of the
data processing systems and the information transfers of an organization.
Network Security
• Security attack:
• 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.
• Release of message contents : learning the contents from
the transmissions. E.g. Telephone conversation
• Traffic analysis : the process of intercepting and examining
messages in order to deduce information from patterns
Network Security
• Security attack:
• Active Attacks
• involve some modification of the data stream or the creation of a
false stream
• Masquerade : takes place when one entity pretends to be a
different entity
Encryption: Y = EK(X)
Decryption: X = DK(Y)
• Characterization of Cryptographic systems
• Type Operation used for Plaintext to Ciphertext conversion
• Encryption algorithms based on two principles:
• Substitution (Each element of PT is mapped to another element)
• Transposition (Elements in PT are rearranged)
• No information be lost (fundamental requirement)
• Number of keys used
• Same key used for encryption and decryption called symmetric, single-key
encryption
• Different keys are used : Asymmetric or public- key
• Way of processing plain text
• Block cipher: input block of elements at a time, output is also a block
• Stream cipher: input elements continuously, output one element at a time
Types of Attacks on Encrypted Messages
Cryptanalyst has complete knowledge of the encryption
algorithm used.
Ciphertext only attack:
• The cryptanalyst has the ciphertext of several messages, all of
which have been encrypted using the same encryption algorithm.
• The cryptanalyst’s job is to recover the plaintext of as many
messages as possible, or better yet to derive the key(s) used to
encrypt the messages
128 2128 = 3.4 1038 2127 µs= 5.4 1024 years 5.4 1018 years
168 2168 = 3.7 1050 2167 µs= 5.9 1036 years 5.9 1030 years
26 characters
26! = 4 1026 2 1026 µs= 6.4 1012 years 6.4 106 years
(permutation)
SUBSTITUTION TECHNIQUES
• A substitution technique is one in which the letters of
plaintext are replaced by other letters or by numbers or
symbols.
• Caesar Cipher or Shift Cipher
• The earliest known, and the simplest form of substitution cipher
was by Julius Caesar.
• It involves replacing each letter of the alphabet with the letter
standing three places further down the alphabet
SUBSTITUTION TECHNIQUES
• Replace letters of a message by other distinct letters a fixed
distance away
• Plaintext: I CAME I SAW I CONQUERED
• Ciphertext: L FDPH L VDZ L FRQTXHUHG
• Shift by 3 letters
• Additive Cipher
• A shift cipher can also be described as
• Encryption, EK(X) = X + K mod 26
• Decryption, DK(X) = X - K mod 26
• for English alphabet by setting up a correspondence between
alphabetic characters and residues modulo 26
• K=3 in Caesar Cipher.
• When the cipher is additive, the plaintext, ciphertext, and key are
integers in Z26.
Example 1:
Use the additive cipher with key = 15 to encrypt the
message “hello”.
Example 2:
• Use the additive cipher with key = 15 to decrypt the
message “WTAAD”.
• We apply the decryption algorithm to the plaintext
character by character:
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Playfair Cipher
• Keyword “INFOSEC”
I/J N F O S
E C A B D
G H K L M
P Q R T U
V W X Y Z
Playfair Cipher
• E.g., Plaintext: “CRYPTO IS TOO EASY”
• Keyword is “INFOSEC”
• Grouped text: CR YP TO IS TO OE AS YX
• Ciphertext: AQ VT YB NI YB IB DF ZY
• To decrypt, the receiver reconstructs the 5 x 5
matrix using the keyword and then uses the same
rules as for encryption
Playfair cipher: Example
GLOW WORM
S T A N D
E R C H B
K F G I L GL OW WO RM
M O P Q U
V W X Y Z
IK WT TW EO
Hill Cipher
• Multi letter cipher developed by Lester Hill in 1929
• Encryption algorithm takes successive m plain text
letters and substitutes for m ciphertext letter
• Substitution is determined by m linear equations in
which each character is assigned a numerical value
• Takes two or three or more letter combinations to
the same size combinations, e.g. “the” → “rqv”
• An example of a “block” cipher encrypting a block
of text at a time
• Hill Algorithm
• The substitution is determined by linear equations in
which each character is assigned a numerical value (a
= 0, b= 1, …….z = 25)
• For m = 3, the system can be described as
• For example, consider the plaintext “PAYMOREMONEY” and use the
encryption key.
17 17 5
• K = 21 18 21
2 2 19
• Encryption : C = KP (mod26)
• Decryption : P = CK-1 (mod26)
C1 9 18 10 p1
C2 = 16 21 1 p2 (mod 26)
C3 5 12 23 p3
4 9 18 10 8
14 = 16 21 1 2 (mod 26)
12 5 12 23 0
19 9 18 10 13
12 = 16 21 1 19 (mod 26)
14 5 12 23 3
18 9 18 10 14
21 = 16 21 1 8 (mod 26)
9 5 12 23 19
Hill Cipher
• Decryption
• Decryption requires using the inverse of the matrix
K.
Transposition Cipher
• Method of encrypting by performing some sort of
permutation on the plain text letters
• Two methods involved
• Rail fence Method
• Columnar Transposition Method
• Rail fence Method
• The Rail Fence cipher is a form of transposition cipher that gets its
name from the way in which it is encoded.
• In the rail fence cipher, the plaintext is written downwards on
successive "rails" of an imaginary fence, then moving up when we
get to the bottom.
• The message is then read off in rows.
• For example, using three "rails" and a message of 'WE ARE
DISCOVERED. FLEE AT ONCE', the cipher writes out:
Transposition Method
• Columnar Transposition
• More complex scheme where message is written in a rectangle, row
by row, and read the message off, column by column, but permute
the order of the columns.
• The order of the columns then becomes the key to the algorithm.