Encryption in Network Criptography
Encryption in Network Criptography
Encryption in Network Criptography
Cryptography
1
Definitions
2
Concepts
Encryption C = EK(P)
Decryption P = EK-1(C)
EK is chosen from a family of
transformations known as a cryptographic
system.
The parameter that selects the individual
transformation is called the key K, selected
from a keyspace K
3
Algorithm Secrecy
Some cryptographic methods rely on the
secrecy of the algorithms; such algorithms
are only of historical interest and are not
adequate for real-world needs.
6
Asymmetric Algorithms
Asymmetric ciphers (also called public-key
algorithms or generally public-key
cryptography) permit the encryption key to
be public (it can even be published in a
newspaper), allowing anyone to encrypt
with the key, whereas only the proper
recipient (who knows the decryption key)
can decrypt the message. The encryption
key is also called the public key and the
decryption key the private key or secret key.
7
Symmetric Algorithms are
Faster
Generally, symmetric algorithms are much
faster to execute on a computer than
asymmetric ones. In practice they are often
used together, so that a public-key
algorithm is used to encrypt a randomly
generated encryption key, and the random
key is used to encrypt the actual message
using a symmetric algorithm.
8
Cryptography Through
History
Cryptography has a history of at least 4000
years
Ancient Egyptians enciphered some of their
hieroglyphic writing on monuments
Ancient Hebrews enciphered certain words in
the scriptures
2000 years ago Julius Ceasar used a simple
substitution cipher, now known as the Caesar
cipher
Roger Bacon described several methods in
1200s
9
Cryptography Through
History
Geoffrey Chaucer included several ciphers
in his works
Leon Alberti devised a cipher wheel, and
described the principles of frequency
analysis in the 1460s
Blaise de Vigenère published a book on
cryptology in 1585, & described the
polyalphabetic substitution cipher
increasing use, especially in diplomacy &
war over centuries 10
History - Scytale Cipher
The Spartans enciphered and concealed a
message by using a scytale, a special stick and
belt. The encipherer would wrap the belt around
the stick and write a message on it. The belt was
then unwound from the stick and sent to another
person. Using a stick of similar size, the
decipherer would wrap the belt around the stick
to watch the secret message appear. If a stick of
the wrong size appeared the message would be
scrambled. Try this with 2 or 3 pencils bound
together to make a stick, a long strip of paper,
and another pencil for writing. 11
Scytale Cipher
An early Greek transposition cipher a strip of
paper was wound round a staff message
written along staff in rows, then paper removed
leaving a strip of seemingly random letters
Not very secure as key was width of paper &
staff
12
Machine Ciphers
Jefferson cylinder, developed in 1790s,
comprised 36 disks, each with a random
alphabet, order of disks was key, message was
set, then another row became cipher
13
Machine Ciphers
Wheatstone disc,
originally invented
by Wadsworth in
1817, but developed
by Wheatstone in
1860's, comprised
two concentric
wheels used to
generate a
polyalphabetic
cipher
14
Enigma
Enigma Rotor machine, one of a very
important class of cipher machines, heavily
used during 2nd world war,
comprised a series of rotor wheels with
internal cross-connections, providing a
substitution using a continuously changing
alphabet
15
Figure - Enigma
16
History - Caesar Cipher
Julius Caesar used a simple alphabet
(letter) substitution, offset by 3 letters.
Taking the word "help" you would move
ahead in the alphabet 3 letters to get
"jgnr." This worked for a while, until more
people learned to read and studied his
secret cipher.
17
History - Manual on
Cryptology
Gabriel de Lavinde made cryptology a more
formally understood science when he
published his first manual on cryptology in
1379.
A variety of codes and mechanical devices
were developed over the next few
centuries to encode, decode, encipher, and
decipher messages.
18
History - The Grille
In the 1600's Cardinal Richelieu invented
the grille. He created a card with holes in it
and used it to write a secret message.
When he was done he removed the card
and wrote a letter to fill in the blanks and
make the message look like a normal letter.
The grille proved to be difficult to solve
unless the decoder had the card which
created the encrypted message.
19
History - The Grille
20
History - The Rosetta Stone
The Rosetta Stone (black basalt), found in
Egypt in 1799, had a message encrypted
on its surface in three different languages!
Greek, Egyptian, and Hieroglyphics
messages all said the same thing. Once the
Greek and Egyptian languages were found
to have the same message the
Hieroglyphics language was deciphered by
referencing each letter to a symbol!
21
Morse Code
22
Classical Cryptographic
Techniques
We have two basic components of classical
ciphers: substitution and transposition
Substitution: In substitution ciphers
letters are replaced by other letters
Transposition: In transposition ciphers
the letters are arranged in a different order
23
Monoalphabetic and
Polyalphabetic Ciphers
Monoalphabetic - only one substitution/
transposition is used
Polyalphabetic - where several
substitutions/ transpositions are used
Several such ciphers may be concatenated
together to form a Product Cipher
24
Caesar Cipher - A Monoalphabetic
Substitution Cipher
Replace each letter of message by a letter a
fixed distance away e.g. use the 3rd letter on
Reputedly used by Julius Caesar, e.g.
L FDPH L VDZ L FRQTXHUHG
I CAME I SAW I CONQUERED
i.e. mapping is
ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZABC
Can describe this cipher as:
Encryption Ek : i -> i + k mod 26
Decryption Dk : i -> i - k mod 26
25
26
Transposition Ciphers
Transposition or permutation ciphers hide
the message contents by rearranging the
order of the letters
Scytale Cipher is an example of a
transposition cipher
27
Transposition Cipher
Example (1)
28
One Time Pad
A one-time pad is a very simple yet completely
unbreakable symmetric cipher.
A one-time pad involves sheets of paper with
random numbers on them: These numbers are
used to transform the message; each number
or sequence of numbers is used only once.
The recipient of the message has an identical
pad to use to decrypt the message. One-time
pads have been proven to be foolproof-without
having a copy of the pad.
Supposedly, mathematicians can prove that a
one-time pad is impossible to break. 29
One Time Pad Algorithm
The cipher itself is exceedingly simple. To
encrypt plaintext, P, with a key, K, producing
ciphertext, C, simply compute the bitwise
exclusive-or of the key and the plaintext:
C = K XOR P
To decrypt ciphertext, C, the recipient
computes
P = K XOR C
It's that simple, and it's perfectly secure, as
long as the key is random and is not
compromised.
30
Trapdoor problem
A trapdoor is a mathematical formula that is easy to
work forward but very hard to work backward. In
general it is easy to multiply two very large numbers
together, but it is very difficult to take a very large
number and find its two prime factors. Public key
algorithms depend on a person publishing a large
public key and others being unable to factor this
public key into its component parts. Because the
creator of the key knows the factors of his or her
large number, he or she can use those factors to
decode messages created by others using his or her
public key. Those who only know the public key will
be unable to discover the private key, because of the
difficulty of factoring the large number.
31
Uses of Encryption
Protecting data from prying eyes is not the
only security issue in networking. One can
imagine at least four security services:
Protecting data from being read by
unauthorized persons
Verifying the sender of each message
(authentication)
Preventing unauthorized persons from
inserting or deleting messages
Making it possible for users to send signed
documents electronically
Encryption can be used to achieve all these
goals. 32
Uses of Encryption
Encryption may be used for:
Confidentiality
User Authentication
Message Authentication
Proof of Origin
33
Location of Encryption in OSI
Model
The location of encryption in the OSI
model has been so controversial that all
mention of the subject was omitted from
the initial standard.
In theory, encryption can be done in any
layer, but in practice three layers seem the
most suitable: physical, transport, and
presentation.
34
Encryption at the Physical
Layer
When encryption is done on the physical layer,
an encryption unit is inserted between each
computer and the physical medium.
Every bit leaving the computer is encrypted
and every bit entering a computer is
decrypted. This scheme is called link
encryption.
It is simple , but relatively inflexible.
35
Link Encryption
36
Encryption at the Transport
Layer
When encryption is done in the transport
layer, the entire session is encrypted.
A more sophisticated approach is to put it in
the presentation layer, so that only those data
structures or fields requiring encryption must
suffer the overhead of it.
37
Negotiated Secure Sessions
38
Secure Internet Tunnels
39
Cryptanalysis and Attacks on
Cryptosystems
Cryptanalysis is the art of deciphering
encrypted communications without
knowing the proper keys.
There are many cryptanalytic techniques.
Some of the more important ones for a
system implementers are described herein.
40
Ciphertext-only Attack
This is the situation where the attacker does not
know anything about the contents of the
message, and must work from ciphertext only. In
practice it is quite often possible to make guesses
about the plaintext, as many types of messages
have fixed format headers. Even ordinary letters
and documents begin in a very predictable way.
It may also be possible to guess that some
ciphertext block contains a common word.
41
Known-plaintext Attack
The attacker knows or can guess the
plaintext for some parts of the ciphertext.
The task is to decrypt the rest of the
ciphertext blocks using this information.
This may be done by determining the key
used to encrypt the data, or via some
shortcut.
42
Chosen-plaintext Attack
The attacker is able to have any text he
likes encrypted with the unknown key. The
task is to determine the key used for
encryption. Some encryption methods,
particularly RSA, are extremely vulnerable
to chosen-plaintext attacks. When such
algorithms are used, extreme care must be
taken to design the entire system so that
an attacker can never have chosen
plaintext encrypted.
43
Unconditional and
Computational Security
Two fundamentally different ways ciphers
may be secure
Unconditional security
no matter how much computer power is
available, the cipher cannot be broken
Computational security
given limited computing resources (e.g. time
needed for calculations is greater than age of
universe), the cipher cannot be broken
44