0% found this document useful (0 votes)
8 views

Lecture 2 A Cryptography

Uploaded by

Kedir Mohammed
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lecture 2 A Cryptography

Uploaded by

Kedir Mohammed
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

A Cryptography Primer

Overview
Cryptography Overview
Symmetric Encryption
Asymmetric Encryption
Hashing Algorithm
Basics of Cryptography
Cryptography is the science of using mathematics to encrypt and decrypt data.
Cryptography enables you to store sensitive information or transmit it across
insecure networks (like the Internet) so that it cannot be read by anyone except
the intended recipient.
While cryptography is the science of securing data, cryptanalysis is the science
of analyzing and breaking secure communication. Classical cryptanalysis
involves an interesting combination of analytical reasoning, application of
mathematical tools, pattern finding, patience, determination, and luck.
Cryptanalysts are also called attackers.
When Julius Caesar sent messages to his generals, he didn't trust his
messengers. So he replaced every A in his messages with a D, every B with an E,
and so on through the alphabet. Only someone who knew the “shift by 3”rule
could decipher his messages. And so we begin.
Cryptography (Encryption Techniques)

Terminology
Terminology

Cryptography:
Cryptography:Schemes
Schemesfor
forencryption
encryptionand
anddecryption
decryption

Encryption:
Encryption:The
Theprocess
processby
bywhich
whichplaintext
plaintextisisconverted
convertedinto
intocipher-text.
cipher-text.

Decryption:
Decryption:Recovering
Recoveringplaintext
plaintextfrom
fromthe
thecipher-text
cipher-text

Secret
Secret key:
key: Used
Used to
to set
set some
some or
or all
all of
of the
the various
various parameters
parameters used
used by
by the
the
encryption
encryptionalgorithm.
algorithm.

Cryptanalysis:
Cryptanalysis:The
Thestudy
studyof
of“breaking
“breakingthe
thecode”.
code”.

Cryptology:
Cryptology: Cryptography
Cryptography and
and cryptanalysis
cryptanalysis together
together constitute
constitute the
the area
area
of
ofcryptology.
cryptology.
Cryptography

Cryptography
Cryptography hashas five
five ingredients:
ingredients:
•• Plaintext
Plaintext
•• Encryption
Encryption algorithm
algorithm
•• Secret
Secret Key
Key
•• Ciphertext
Ciphertext
•• Decryption
Decryption algorithm
algorithm
Security
Security depends
depends on
on the
the secrecy
secrecy of
of the
the key,
key, not
not the
the secrecy
secrecy of
of the
the
algorithm
algorithm
Cryptography
Simplified
Simplified Encryption
Encryption Model:
Model:
Cryptography
Description:
Description:
A
Asender
sender SS needs
needs toto transmit
transmit message
message MM toto aa receiver
receiver R
R
To
To protect
protect the
the message
message M,M, the
the sender
sender first
first encrypts
encrypts itit into
into an
an
unintelligible
unintelligible message
message M’ M’
After
Afterreceipt
receipt of
of M’,
M’, R R decrypts
decrypts the
the message
message to to obtain
obtain M
M
M
M isis called
called the
the plaintext
plaintext

What
Whatwe
wewants
wantsto
toencrypt
encrypt
M’
M’isis called
called the
the ciphertext
ciphertext

The
Theencrypted
encryptedoutput
output
Cryptography
Notation:
Notation:


Given
Given

P=Plaintext
P=Plaintext

C=CipherText
C=CipherText

k=key
k=keyshared
sharedby
bysender
senderand
andreceiver
receiver

CC == EEKK (P)
(P) Encryption
Encryption

PP== D
DKK (C)
(C) Decryption
Decryption
Cryptography
Caesar
Caesar Cipher
Cipher -- early
early example:
example:
Caesar
Caesar Cipher:
Cipher: TheThe earliest
earliest known
known example
example of of aa
substitution
substitution cipher
cipher in
in which
which each
each character
character of
of aa message
message isis
replaced
replaced by by aa character
character three
three position
position down
down in in the
the
alphabet.
alphabet.
 Plaintext: are
Plaintext: are you
you ready
ready
 Ciphertext: duh
Ciphertext: duh brx
brx uhdgb
uhdgb
Cryptography

Types
Types of
of attacks
attacks

The
The attacker
attacker has
has only
only the
the ciphertext
ciphertext and
and his
his goal
goal isis to
to find
find the
the
corresponding
corresponding plaintext
plaintext

The
The attacker
attacker has
has aa ciphertext
ciphertext and
and the
the corresponding
corresponding plaintext
plaintext
and
and his
his goal
goal isis to
to find
find the
the key
key

A
Agood
good cryptosystem
cryptosystem protects
protects against
against all
all types
types of
of attacks
attacks
Attackers
Attackers use
use both
both Mathematics
Mathematics and
and Statistics
Statistics
Cryptography
Cryptography
Cryptography and
and Intruders
Intruders

Eavesdropping
Eavesdropping (listening/spying
(listening/spying thethe message)
message)
An
Anintruder
intrudermay
maytrytryto
toread
readthe
themessage
message
If
Ifititisiswell
wellencrypted
encryptedthetheintruder
intruderwill
willnot
notknow
knowthe
thecontent
content

However
However,, just
just the
the fact
fact the
the intruder
intruder knows
knows that
that there
there isis communication
communication
may
maybe
beaathreat
threat(Traffic
(Trafficanalysis)
analysis)

Modification
Modification

Modifying
Modifying aa plaintext
plaintext isis easy,
easy, but
but modifying
modifying encrypted
encrypted messages
messages isis more
more
difficult
difficult

Insertion
Insertion of of messages
messages

Inserting
Insertingnew
newmessage
messageinto intoaacipher-text
cipher-textisisdifficult
difficult
Cryptography

There
There are
are two
two fundamentally
fundamentally different
different cryptographic
cryptographic
systems
systems

Symmetric
Symmetric cryptosystem/
cryptosystem/ Private
Private key
key

Asymmetric
Asymmetric cryptosystem/
cryptosystem/ Public
Public key
key
Cryptography
Symmetric
Symmetric Cryptosystem
Cryptosystem

Also
Also called
called secret-key/private-key
secret-key/private-key cryptosystem
cryptosystem
The
The same
same key
key isis used
used to
to encrypt
encrypt and
and decrypt
decrypt aa message
message
Have
Have been
been used
used for
forcenturies
centuries in
in aa variety
variety of
of forms
forms
The
The key
key has
has to
to be
be kept
kept secret
secret
The
The key
key has
has to
to be
be communicated
communicated using
using aa secure
secure channel
channel
Cryptography
DES
DES--Popular
PopularExample
Exampleof
of Symmetric
SymmetricCryptosystem
Cryptosystem

In
In 1973,
1973, the
the NBS
NBS (National
(National Bureau
Bureau of
of Standards,
Standards, now
now called
called NIST
NIST --
National
National Institute
Institute of
of Standards
Standards and
and Technology)
Technology) published
published aa request
request
for
foran
an encryption
encryption algorithm
algorithm that
that would
would meet
meet the
the following
following criteria:
criteria:
have
haveaahigh
highsecurity
securitylevel
level
be
beeasily
easilyunderstood
understood
not
notdepend
dependon
onthe
thealgorithm's
algorithm'sconfidentiality
confidentiality
be
beadaptable
adaptableand
andeconomical
economical
be
beefficient
efficientand
andexportable
exportable
Cryptography
DES
DES--Popular
PopularExample
Exampleof
of Symmetric
SymmetricCryptosystem
Cryptosystem

In
In late
late 1974,
1974, IBM
IBM proposed
proposed "Lucifer",
"Lucifer",
which
which was
was then
then modified
modified by
by NSA
NSA (National
(National Security
Security Agency)
Agency) in
in 1976
1976
to
to become
become the
the DES
DES (Data
(Data Encryption
Encryption Standard).
Standard).
DES
DES was
was approved
approved by
by the
the NBS
NBS in
in 1978.
1978.
The
The DES
DES was
was standardized
standardized by
by the
the ANSI
ANSI under
under the
the name
name of
of ANSI
ANSI
X3.92,
X3.92,
also
also known
known as
as DEA
DEA(Data
(Data Encryption
EncryptionAlgorithm).
Algorithm).
Cryptography
Asymmetric/Public
Asymmetric/Public key/
key/ Cryptosystem
Cryptosystem

Also
Alsocalled
calledpublic-key
public-keycryptosystem
cryptosystem

keys
keysfor
forencryption
encryptionand
anddecryption
decryptionare
aredifferent
differentbut
butform
formaaunique
uniquepair
pair

Only
Onlyone
oneof
ofthe
thekeys
keysneed
needto
tobe
beprivate
privatewhile
whilethe
theother
othercan
canbe
bepublic
public
Invented
Inventedby
byDiffie
Diffieand
andHellman
Hellmanin
in1976
1976

Uses
UsesMathematical
Mathematicalfunctions
functionswhose
whoseinverse
inverseisisnot
notknown
knownby
byMathematicians
Mathematiciansof
ofthe
theday
day
No
Noneed
needsecure
securechannel
channelto
tocommunicate
communicatethe
thekey
key
ItIt has
has made
made cryptography
cryptography available
available for
for the
the general
general public
public and
and made
made many
many of
of today’s
today’s on-
on-
line
lineapplication
applicationfeasible
feasible
Cryptography
Public-key
Public-key Cryptosystem
Cryptosystem
Examle:
Examle:

If
IfSeble
Seblewants
wantsto
tosend
sendaaconfidential
confidentialmessage
messageto
toBerhanu
Berhanu

She
Sheencrypts
encryptsthe
themessage
messageusing
usingBerhanu’s
Berhanu’spublic
publickey
key

Send
Sendthe
themessage
message

Berhanu
Berhanuwill
willthen
thendecode
decodeititusing
usinghis
hisown
ownprivate
privatekey
key

On
On the
the other
other hand,
hand, ifif Berhanu
Berhanu needs
needs to
to make
make sure
sure that
that aa message
message sent
sent by
by
Seble
Seblereally
reallycomes
comesfrom
fromher,
her,how
howcan
canhe
hemake
makethat?
that?
Cryptography

Digital signatures enable the recipient of information to verify the authenticity


of the information’s origin, and also verify that the information is intact. Thus,
public key digital signatures provide authentication and data integrity.
A digital signature also provides non-repudiation, which means that it prevents
the sender from claiming that he or she did not actually send the information.
A digital signature serves the same purpose as a handwritten signature.
However, a handwritten signature is easy to counterfeit. A digital signature is
superior to a handwritten signature in that it is nearly impossible to counterfeit,
plus it attests to the contents of the information as well as to the identity of the
signer.
Cryptography
Public-key
Public-key Cryptosystem
Cryptosystem

Using
Using digital
digital signature
signature

Seble
Seblehas
hasto
tofirst
firstencrypt
encryptaadigital
digitalsignature
signatureusing
usingher
herprivate
privatekey
key

Then
Thenencrypt
encryptthe
themessage
message(signature
(signatureincluded)
included)with
withBerhanu’s
Berhanu’spublic
publickey
key

Sends
Sendsthe
theencrypted
encryptedmessage
messageto
toBerhanu
Berhanu

Berhanu
Berhanudecrypts
decryptsthe
themessage
messageusing
usinghis
hisprivate
privatekey
key

Berhanu
Berhanuthen
thendecrypts
decryptsthe
thesignature
signatureusing
usingSeble’s
Seble’spublic
publickey
key

If
Ifsuccessful,
successful,he
heinsures
insuresthat
thatititcomes
comesfrom
fromSeble
Seble
Cryptography
Public-key
Public-key Cryptosystem:
Cryptosystem: Example
ExampleRSA
RSA

RSA
RSAisisfrom
fromR.
R.Rivesh,
Rivesh,A.
A.Shamir
Shamirand
andL.
L.Aldermen
Aldermen
Principle:
Principle: No
No mathematical
mathematical method
method isis yet
yet known
known to
to efficiently
efficiently find
find the
the prime
prime factors
factors of
of
large
largenumbers
numbers
In
In RSA,
RSA, the
the private
private and
and public
public keys
keys are
are constructed
constructed from
from very
very large
large prime
prime numbers
numbers
(consisting
(consistingof
ofhundred
hundredof
ofdecimal
decimaldigits)
digits)
One
Oneof
ofthe
thekeys
keyscan
canbe
bemade
madepublic
public

Breaking
Breaking RSA RSA isis equivalent
equivalent to
to finding
finding the
the prime
prime factors:
factors: this
this isis know
know to
to be
be
computationally
computationallyinfeasible
infeasible
ItItisisonly
onlythe
theperson
personwho
whohas
hasproduced
producedthethekeys
keysfrom
fromthe
theprime
primenumber
numberwho whocan
caneasily
easily
decrypt
decryptthe themessages
messages
Cryptography
Public-key
Public-key Cryptosystem
Cryptosystem

Summary
Summary

AApair
pairof
of keys
keys (private,
(private, public)
public)

If
If you
you have
have the
the private
private key,
key, you
you can
can easily
easily decrypt
decrypt what
what isis
encrypted
encrypted by
by the
the public
public key
key

Otherwise,
Otherwise, itit isis computationally
computationally infeasible
infeasible to
to decrypt
decrypt what
what has
has
been
been encrypted
encrypted by
by the
the public
public key
key
Cryptography

Hashing Cryptographic Algorithms


A cryptographic hash function is a hash function which takes an input as an arbitrary (or
'message') and returns a fixed-size alphanumeric string. The string is called the 'hash value',
'message digest', 'digital fingerprint', 'digest' or 'checksum').
Hashing is the transformation of a string of characters into a usually shorter fixed-length value or
key that represents the original string.
Hashing is used to index and retrieve items in a database because it is faster to find the item using
the shorter hashed key than to find it using the original value.
It is also used in many encryption algorithms.
It is infeasible to modify the message without changing the hash.

You might also like