You are on page 1of 75

Network Security &

Cryptography

UOB

Bill Figg 1
What is a network?
A network consists of two or more
devices that are linked in order to share
resources or allow communications.

Can you think of various forms of a


network?

2
Computer Networks
Send in
homework
Download
music
facebook
INTERNET

email

chat

3
Phone Networks
business
Text
call
messaging

call
friend

call
mum Transmitter
tower
Transmitter
tower
Text
messaging

call
friend
call
Text business
daughter
messaging call 4
Satellite
Networks

Dish network

Football game Watching the game


5
in Europe In Bryan Texas, USA
What is security?

Security is the act of protecting a person,


property or organization from an attack.

• Examples of attack on a person?

• Examples of attack on a property?

• Examples of attack on a organization?

6
Why do we need network
security

bad guy
INTERNET listens to the
communication
data
i ti ve
sens

email
Name: ALICE JACK
Address: 1 BALL STR
Phone Number: 888-9191
DOB: 01/21/1993
SSN: 999-111-2323
Credit Card No:. 9988 5321
School Nurse
Medical Records, Test scores

7
Why do we need
network security?

• Can you think of ways a bad guy can


use the data he obtains to cause harm
or attack? Give examples and reasons
for attacks.

• Can you think of what you can do to


prevent a bad guy from having access
to your private data or information?
8
• Security service – A service that enhances
the security of the data processing systems
and the information transfers of an
organization. The services are intended to
counter security attacks and they make use
of one or more security mechanisms to
provide the service.

9
Introduction
• computers require confidentiality,
integrity, and availability. The
implementation of these requirements,
however, is different and more
challenging. During the last two
decades, computer networks created a
revolution in the use of information.
10
• Information is now distributed. Authorized
people can send and retrieve information
from a distance using computer networks.
Although the three above-mentioned
requirements
confidentiality, integrity, and availability have
not changed,

11
• they now have some new dimensions.
Not only should information be
confidential when it is stored in a
computer; there should also be a way to
maintain its confidentiality when it is
transmitted from one computer to
another
12
SECURITY GOALS
• Let us first discuss three security goals:
confidentiality, integrity, and availability

13
•Computer data often travels from one
computer to another, leaving the safety of its
protected physical surroundings. Once the data
is out of hand, people with bad intention could
modify or forge your data, either for amusement
or for their own benefit. 14
• Cryptography can reformat and
transform our data, making it safer on
its trip between computers. The
technology is based on the essentials
of secret codes, augmented by
modern mathematics that protects our
data in powerful ways.
15
 Computer Security - generic name for the
collection of tools designed to protect data and
to thwart hackers.
 Network Security - measures to protect data
during their transmission.
 Internet Security - measures to protect data
during their transmission over a collection of
interconnected networks.
16
Security Attacks, Services
and Mechanisms
• To assess the security needs of an
organization effectively, the manager
responsible for security needs some
systematic way of defining the requirements
for security and characterization of
approaches to satisfy those requirements.
One approach is to consider three aspects of
information security: 17
• Security attack – Any action that compromises
the security of information owned by an
organization.
• Security mechanism – A mechanism that is
designed to detect, prevent or recover from a
security attack.

18
What is Cryptography?

• “Cryptography is the standard of


encrypting all the data and information
by converting Plain text into cipher text
for secure communication.”

19
Encryption
• In a simplest form, encryption is to convert
the data in some unreadable form. This helps
in protecting the privacy while sending the
data from sender to receiver. On the receiver
side, the data can be decrypted and can be
brought back to its original form.
20
Decryption
• Decryption is the process of converting
an encrypted message back to its original
(readable) format.

21
22
23
Types of Cryptography
• Cryptography is further classified into three
different categories:
1. Symmetric Key Cryptography (Private/Secret
Key Cryptography)
2. Asymmetric Key Cryptography (Public Key
Cryptography)
3. Hash Function
24
Types of operations
• Type of operations used for transforming plain
text to cipher text
• All the encryption algorithms are based on two
general principles: substitution, in which each
element in the plaintext is mapped into
another element, and transposition, in which
elements in the plaintext are rearranged.
25
The number of keys used
• If the sender and receiver uses same key then
it is said to be symmetric key (or) single key
(or) conventional encryption.
• If the sender and receiver use different keys
then it is said to be public key encryption.
• The way in which the plain text is processed
• A block cipher processes the input and block of
elements at a time, producing output block for
each input block. 26
28
History of Cryptography

29
30
Classical ciphers

1. Caesar Cipher
2. Monoalphabetic Ciphers
3. Playfair Cipher
4. Hill Cipher
5. Polyalphabetic Ciphers
6. One-Time Pad 31
Cryptography

Cryptography
– The process of converting a message into a
secret code called CIPHER TEXT, and changing
the encoded message back to regular text called
PLAIN TEXT.
(1) Encryption
– The conversion of the original message into a
secret code or CIPHER TEXT using a key.
(2) Decryption
– The conversion of the encoded message or
PLAIN TEXT back to the original message using
the same key.
32
Its All About Keys !!!

My name is
Alice Jack.
Encryption Wi
Wixkwo
xkwosc
sckvsmo
kvsmotkmu
tkmu
cypher text
Plain text key

key

Wi My name is
Wixkwo
xkwosc
sckvsmo
kvsmotkmu
tkmu Decryption Alice Jack.

33
Alphabets

37
Caesar cipher

• The Caesar cipher is one of the


simplest and oldest methods of
encrypting and decrypting messages.
It is named after Julius Caesar, who is
believed to have used this technique
during his time.
38
Continue….
• The Caesar cipher is a substitution cipher,
where each letter in the plaintext is shifted a
certain number of positions down the
alphabet. For example, if we choose a shift
value of 3, the letter 'A' would be encrypted as
'D', 'B' as 'E', and so on. The shifted alphabets
wrap around to the beginning if necessary.
39
To encrypt a message using the Caesar
cipher:
1. Choose a shift value (also known as the key).
2. Take each letter in the plaintext and shift it
by the chosen value.
3. Wrap around to the beginning of the alphabet
if necessary.
4. The resulting message is the ciphertext.
40
For example,

• let's encrypt the word "HELLO" with a shift


value of 2:
• 'H' shifted by 2 positions becomes 'J'
• 'E' shifted by 2 positions becomes 'G'
• 'L' shifted by 2 positions becomes 'N'
• 'L' shifted by 2 positions becomes 'N'
• 'O' shifted by 2 positions becomes 'Q' 41
• So the ciphertext for "HELLO" with a
shift value of 2 would be "JGNNQ".
• To decrypt a message encrypted with the
Caesar cipher, you follow the same
process in reverse:
42
Continue

1. Know the shift value used for encryption.


2. Take each letter in the ciphertext and shift
it back by the same value.
3. Wrap around to the end of the alphabet if
necessary.
4. The resulting message is the plaintext. 43
Using the same example, if we have the
ciphertext "JGNNQ" with a shift value of 2, we
can decrypt it to get the original plaintext
"HELLO".
Although the Caesar cipher is a straightforward
encryption technique, it is considered weak and
insecure by modern standards. It has only 25
possible shift values, making it vulnerable to
brute-force attacks. However, it serves as a
foundation for more complex encryption
algorithms used today. 44
45
Caesar Cipher in
Cryptography
 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”.
46
 The Caesar Cipher technique is one of the
earliest and simplest methods of encryption
technique. 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
47
 Thus, to cipher a given text we need an
integer value, known as a shift which indicates
the number of positions each letter of the text
has been moved down.
 The encryption can be represented using
modular arithmetic by first transforming the
letters into numbers, according to the scheme,
A = 0, B = 1,…, Z = 25. Encryption of a letter
by a shift n can be described mathematically
48
 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:
49
• Here is an example of how to use the
Caesar cipher to encrypt the message
“HELLO” with a shift of 3:
1. Write down the plaintext message: HELLO
2. Choose a shift value. In this case, we will use a
shift of 3.
3. Replace each letter in the plaintext message with
the letter that is three positions to the right in the
alphabet. 50
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)

51
• 4.The encrypted message is now
“KHOOR”.
• To decrypt the message, you simply need
to shift each letter back by the same
number of positions. In this case, you
would shift each letter in “KHOOR” back
by 3 positions to get the original message,
“HELLO”.
52
• E_n(x)=(x+n)mod\ 26
• (Encryption Phase with shift n)
• D_n(x)=(x-n)mod\ 26
• (Decryption Phase with shift n)

53
54
• Examples :
• Text :
ABCDEFGHIJKLMNOPQRSTUVWXYZ
• Shift: 23
• Cipher:
XYZABCDEFGHIJKLMNOPQRSTUVW

55
Example 2
• Text : ATTACKATONCE
• Shift: 4
• Cipher: EXXEGOEXSRGI

56
Advantages:
Easy to implement and use thus, making suitable for
beginners to learn about encryption.
Can be physically implemented, such as with a set of
rotating disks or a set of cards, known as a scytale, which
can be useful in certain situations.
Requires only a small set of pre-shared information.
Can be modified easily to create a more secure variant,
such as by using a multiple shift values or keywords
57
Disadvantages:
 It is not secure against modern decryption
methods.
 Vulnerable to known-plaintext attacks, where
an attacker has access to both the encrypted
and unencrypted versions of the same
messages.

58
 The small number of possible keys means
that an attacker can easily try all possible
keys until the correct one is found, making it
vulnerable to a brute force attack.
 It is not suitable for long text encryption as it
would be easy to crack.
 It is not suitable for secure communication as
it is easily broken.
 Does not provide confidentiality, integrity, and
authenticity in a message. 59
60
Rules for the Caesar Cipher:

61
62
Playfair
• The Playfair cipher was the first practical
digraph substitution cipher. The scheme was
invented in 1854 by Charles
Wheatstone but was named after Lord
Playfair who promoted the use of the cipher.

63
 In playfair cipher unlike traditional cipher we
encrypt a pair of alphabets(digraphs) instead of a
single alphabet.
It was used for tactical purposes by British forces
in the Second Boer War and in World War I and
for the same purpose by the Australians during
World War II. This was because Playfair is
reasonably fast to use and requires no special
equipment
64
Encryption Technique

1:Generate the key Square(5×5):


2:Algorithm to encrypt the plain text(The
plaintext is split into pairs of two letters (digraphs).
If there is an odd number of letters, a Z is added to
the last letter)
65
Rules for Encryption:
• If both the letters are in the same column: Take
the letter below each one (going back to the top if
at the bottom).
• If both the letters are in the same row: Take the
letter to the right of each one (going back to the
leftmost if at the rightmost position)
66
• If neither of the above rules is true:
Form a rectangle with the two letters and
take the letters on the horizontal opposite
corner of the rectangle.

67
68
69
70
71
72
Hill cipher
• Hill cipher is a polygraphic substitution
cipher based on linear algebra.Each letter
is represented by a number modulo 26.
Often the simple scheme A = 0, B = 1, …,
Z = 25 is used, but this is not an essential
feature of the cipher.

73
• To encrypt a message, each block of n letters
(considered as an n-component vector) is
multiplied by an invertible n × n matrix, against
modulus 26. To decrypt the message, each
block is multiplied by the inverse of the matrix
used for encryption.
• The matrix used for encryption is the cipher
key, and it should be chosen randomly from the
set of invertible n × n matrices (modulo 26)
74
Vigenere Cipher
• The vigenere cipher is an algorithm that is
used to encrypting and decrypting the text.
The vigenere cipher is an algorithm of
encrypting an alphabetic text that uses a
series of interwoven caesar ciphers. It is
based on a keyword's letters.

75
• It is an example of a polyalphabetic
substitution cipher.
• This algorithm is easy to understand and
implement.
• This algorithm was first described in 1553 by
Giovan Battista Bellaso. It uses a Vigenere
table or Vigenere square for encryption and
decryption of the text. The vigenere table is
also called the tabula recta.
76
• Example: The plaintext is "JAVATPOINT",
and the key is "BEST".

77
78
• Ciphertext = KENTUTGBOX

79

You might also like