6. 6Solutions www.domain.comCb_salah_salah@esi.dz
History of cryptography
Transposition Cipher
It is another type of cipher where the
order of the alphabets in the plaintext
is rearranged to create the ciphertext.
The actual plaintext alphabets are not
replaced.
Playfair Cipher
In this scheme, pairs of letters are encrypted,
instead of single letters as in the case of simple
substitution cipher
The Vigenere code
It uses a text string (say, a word) as a key, which
is then used for doing a number of shifts on the
plaintext
.
The code of CAESAR
It is a mono-alphabetic cipher
wherein each letter of the plaintext is
substituted by another letter to form
the ciphertex
7. 7Solutions www.domain.com
Exemple:Caesar1
DLWFE TNT DYLVP UP GZFD OTD WP XZE AZFC
ALDDPC WP RCZD NSTPY OF QLXPFI NPDLC
DTTZTSLNYPLA
offset is 15
SALUT ICI SNAKE JE VOUS DIS LE MOT POUR
PASSER LE GROS CHIEN DU FAMEUX CESAR
SIIOIHACNEAP
8. 8Solutions www.domain.com
Exemple: Vigenere2
The sender and the receiver decide on a key. Say ‘point’ is the key. Numeric representation of this key is ‘16
15 9 14 20’.
The sender wants to encrypt the message, say ‘attack from south east’. He will arrange plaintext and numeric
key as follows:
a t t a c k f r o m s o u t h e a s t
16 15 9 14 20 16 15 9 14 20 16 15 9 14 20 16 15 9 14
The Cipher text will be as follows
Q I C O W A U A C G I D D H B U P B H
9. 9Solutions www.domain.com
Exemple: Playfair Cipher3
T U O R I
A L S B C
D E F G H
K M N P Q
V W X Y Z
HI DE MO NE YZ
T U O R I
A L S B C
D E F G H
K M N P Q
V W X Y Z
T U O R I
A L S B C
D E F G H
K M N P Q
V W X Y Z
T U O R I
A L S B C
D E F G H
K M N P Q
V W X Y Z
The sender and the receiver deicide on a particular key, say ‘tuorials’
Let us say we want to encrypt the message “hide money”. It will be written as:
Using these rules, the result of the encryption of ‘hide money’ with the key of ‘tuorials’
would be:
QC EF NU MF ZV
10. 10Solutions www.domain.com
Exemple: Transposition Cipher3
The plaintext is “golden statue is in eleventh cave” and the secret random key chosen is “five”. We arrange this
text horizontally in table with number of column equal to key value. The resulting text is shown below.
G O L D E
N S T A T
U E I S I
N E L E V
E N T H C
A V E
The ciphertext is obtained by reading column vertically downward from first to last column. The ciphertext is
‘gnuneaoseenvltiltedasehetivc’.
12. 12Solutions www.domain.com
• Basicly used in e-commerce but it is
also used in bleu cardes and some
softwares like opnessh(secure
communication using ssh protocol)
• Was first created by Ron Rivest,
Adi Shamir et LenAdleman, en 1977 )
Cb_salah_salah@esi.dz
Asymmetric cryptography : RSA
13. 13Solutions www.domain.comCb_salah_salah@esi.dz
RSA: How Does it Work?
World of cryptography
A single key used for
encryption and
decryption
Called private key
Ex: Ceasar
Two keys are used
One for encryption, known by
every one, called public key.
The other one for decryption,
known only by the receiver,
called private key .
Ex :RSA
Symmetric
cryptography
Asymmetric
cryptography
15. 15Solutions www.domain.comCb_salah_salah@esi.dz
RSA: How to create public and private key?
Public Key: (N,C)
• P ,Q: two prime number
• N=P×Q
• M=(P−1)×(Q−1
• C :coprime number with M
Private Key: (N,U)
• Need to calcualte U
• Theory of Etienne Bézout: to prove
that two numbers a and b are
coprime if only existed two
number u and v that for
a×u+b×v=1 ( u and v are integers)
• It existed u v for that for
C×u+M×v=1
18. 18Solutions www.domain.comCb_salah_salah@esi.dz
RSA: Real keys exemple
N = 31074182404900437213507500358885679300373460228427275457201619488232064405
18081504556346829671723286782437916272838033415471073108501919548529007337
724822783525742386454014691736602477652346609
P = 16347336458092538484431338838650908598417836700330
92312181110852389333100104508151212118167511579
Q = 1900871281664822113126851573935413975471896789968
515493666638539088027103802104498957191261465571
80 processors Opteron 2.2GHz for 5 months to find P and Q