Download as pdf or txt
Download as pdf or txt
You are on page 1of 64

Cryptography I

I‫اﻟﺗﺷﻔﯾر‬

Chapter 4

CSE 451 - Computer & Network Security


Outline
• Introduction - History of 2. The Transposition Cipher
Cryptography Techniques
• Rail Fence Technique
• Cryptography Concepts
• Columnar Transposition Cipher
• Cryptography Techniques • Route Cipher
• Symmetric Encryption
1. The Substitution Cipher
• Caesar Cipher
• Monoalphabetic Ciphers
• Playfair Cipher
• Vigenère Cipher
• One-Time Pad CSE 451 - Computer & Network Security
2
Cryptography

One of most important security mechanisms is cryptography.


.‫واﺣدة ﻣن أھم آﻟﯾﺎت اﻷﻣﺎن ھﻲ اﻟﺗﺷﻔﯾر‬

So, what is cryptography?


‫ ﻣﺎ ھو اﻟﺗﺷﻔﯾر؟‬، ‫إذن‬

CSE 451 - Computer & Network Security


3
Introduction - History of
‫ ﺗﺎرﯾﺦ اﻟﺗﺷﻔﯾر‬- ‫ﻣﻘدﻣﺔ‬
Cryptography
• Cryptography is a an old technique, with early examples dating back
to about 2000 B.C about 4000 years ago. Since Egyptian days
cryptography has been used in one form or the other in many, if not
most, cultures that developed written language.
‫ ﻗﺑل‬2000 ‫ ﻣﻊ أﻣﺛﻠﺔ ﻣﺑﻛرة ﯾﻌود ﺗﺎرﯾﺧﮭﺎ إﻟﻰ ﺣواﻟﻲ‬، ‫اﻟﺗﺷﻔﯾر ھو ﺗﻘﻧﯾﺔ ﻗدﯾﻣﺔ‬
‫ ﺗم اﺳﺗﺧدام اﻟﺗﺷﻔﯾر ﺑﺷﻛل أو‬، ‫ ﻣﻧذ اﻷﯾﺎم اﻟﻣﺻرﯾﺔ‬.‫ ﻋﺎم‬4000 ‫اﻟﻣﯾﻼد ﻣﻧذ ﺣواﻟﻲ‬
.‫ اﻟﺗﻲ طورت ﻟﻐﺔ ﻣﻛﺗوﺑﺔ‬، ‫ إن ﻟم ﯾﻛن ﻣﻌظﻣﮭﺎ‬، ‫ﺑﺂﺧر ﻓﻲ اﻟﻌدﯾد ﻣن اﻟﺛﻘﺎﻓﺎت‬

CSE 451 - Computer & Network Security


4
Introduction - History of Cryptography

• For instance, there are documented


cases of secret writing in ancient
Greece, namely the scytale of Sparta.
‫ ھﻧﺎك ﺣﺎﻻت ﻣوﺛﻘﺔ ﻟﻠﻛﺗﺎﺑﺔ اﻟﺳرﯾﺔ ﻓﻲ اﻟﯾوﻧﺎن اﻟﻘدﯾﻣﺔ‬، ‫ﻋﻠﻰ ﺳﺑﯾل اﻟﻣﺛﺎل‬
.‫ وھﻲ ﻗﺻﺔ ﺳﺑﺎرﺗﺎ‬،
• The ancient Greeks, and the Spartans
used this cipher to communicate during
military campaigns
‫اﺳﺗﺧدم اﻹﻏرﯾﻖ اﻟﻘدﻣﺎء واﻷﺳﺑرطﯾون ھذا اﻟﺷﻔرة ﻟﻠﺗواﺻل أﺛﻧﺎء‬
‫اﻟﺣﻣﻼت اﻟﻌﺳﻛرﯾﺔ‬ CSE 451 - Computer & Network Security
5
Introduction - History of Cryptography
• The famous Caesar cipher in ancient
Rome Julius Caesar (100-44 BC)
• Caesar cipher is the idea of a substitution
cipher. He started the basic form of
encryption for 2,000 years.
(‫ ﻗﺑل اﻟﻣﯾﻼد‬44-100) ‫ﺷﻔرة ﻗﯾﺻر اﻟﺷﮭﯾرة ﻓﻲ روﻣﺎ اﻟﻘدﯾﻣﺔ ﯾوﻟﯾوس ﻗﯾﺻر‬
2000 ‫ ﺑدأ اﻟﺷﻛل اﻷﺳﺎﺳﻲ ﻟﻠﺗﺷﻔﯾر ﻟﻣدة‬.‫ﺗﺷﻔﯾر ﻗﯾﺻر ھو ﻓﻛرة ﺗﺷﻔﯾر اﻻﺳﺗﺑدال‬
‫ﻋﺎم‬

CSE 451 - Computer & Network Security


Medieval copy of Julius
Caesar’s Gallic Wars 6
Cryptography Nowadays
‫اﻟﺗﺷﻔﯾر ﻓﻲ اﻟوﻗت اﻟﺣﺎﺿر‬

• Cryptography had been traditionally confined to very specific


applications, especially government communications and banking
systems.
‫ وﻻ ﺳﯾﻣﺎ اﻻﺗﺻﺎﻻت‬،‫وﻗد اﻗﺗﺻر اﻟﺗﺷﻔﯾر ﺗﻘﻠﯾدﯾﺎ ﻋﻠﻰ ﺗطﺑﯾﻘﺎت ﻣﺣددة ﺟدا‬
.‫اﻟﺣﻛوﻣﯾﺔ واﻟﻧظم اﻟﻣﺻرﻓﯾﺔ‬
• But now!! in everything, from Web browsers and e-mail programs to
cell phones, bank cards, cars and even into medical records.
‫ ﻣن ﻣﺗﺻﻔﺣﺎت اﻟوﯾب وﺑراﻣﺞ اﻟﺑرﯾد اﻹﻟﻛﺗروﻧﻲ‬، ‫ﻟﻛن اﻵن!! ﻓﻲ ﻛل ﺷﻲء‬
‫إﻟﻰ اﻟﮭواﺗف اﻟﻣﺣﻣوﻟﺔ واﻟﺑطﺎﻗﺎت اﻟﻣﺻرﻓﯾﺔ واﻟﺳﯾﺎرات وﺣﺗﻰ ﻓﻲ‬
.‫اﻟﺳﺟﻼت اﻟطﺑﯾﺔ‬

CSE 451 - Computer & Network Security


7
Cryptography ‫اﻟﺗﺷﻔﯾر‬
• Cryptography definition: is the science of secret writing with the goal
of hiding the meaning of a message.
.‫ ھو ﻋﻠم اﻟﻛﺗﺎﺑﺔ اﻟﺳرﯾﺔ ﺑﮭدف إﺧﻔﺎء ﻣﻌﻧﻰ اﻟرﺳﺎﻟﺔ‬:‫ﺗﻌرﯾف اﻟﺗﺷﻔﯾر‬

CSE 451 - Computer & Network Security


8
Cryptography
:‫ﺗﺗﻣﯾز أﻧظﻣﺔ اﻟﺗﺷﻔﯾر ﻋﻠﻰ ﺛﻼﺛﺔ أﺑﻌﺎد ﻣﺳﺗﻘﻠﺔ‬
• Cryptographic systems are characterized along three independent dimensions:
• 1. The type of operations used for transforming plaintext to ciphertext. All encryption
algorithms are based on two general principles: substitution, and permutation
(transposition). ‫ ﺗﻌﺗﻣد ﺟﻣﯾﻊ‬.‫ ﻧوع اﻟﻌﻣﻠﯾﺎت اﻟﻣﺳﺗﺧدﻣﺔ ﻟﺗﺣوﯾل اﻟﻧص اﻟﻌﺎدي إﻟﻰ ﻧص ﻣﺷﻔر‬.1
.(‫ اﻻﺳﺗﺑدال واﻟﺗﻘﻠﯾب )اﻟﺗﺑدﯾل‬:‫ﺧوارزﻣﯾﺎت اﻟﺗﺷﻔﯾر ﻋﻠﻰ ﻣﺑدأﯾن ﻋﺎﻣﯾن‬
• 2. The number of keys used. If both sender and receiver use the same key, the system is
referred to as symmetric, single-key, secret-key, or conventional encryption. If the sender
and receiver use different keys, the system is referred to as asymmetric, two-key, or
public-key encryption.
‫ ﯾﺷﺎر إﻟﻰ اﻟﻧظﺎم‬، ‫ إذا ﻛﺎن ﻛل ﻣن اﻟﻣرﺳل واﻟﻣﺳﺗﻘﺑل ﯾﺳﺗﺧدﻣﺎن ﻧﻔس اﻟﻣﻔﺗﺎح‬.‫ ﻋدد اﻟﻣﻔﺎﺗﯾﺢ اﻟﻣﺳﺗﺧدﻣﺔ‬.2
‫ إذا ﻛﺎن اﻟﻣرﺳل واﻟﻣﺳﺗﻘﺑل‬.‫ﻋﻠﻰ أﻧﮫ ﺗﺷﻔﯾر ﻣﺗﻣﺎﺛل أو ﻣﻔﺗﺎح واﺣد أو ﻣﻔﺗﺎح ﺳري أو ﺗﺷﻔﯾر ﺗﻘﻠﯾدي‬
.‫ ﯾﺷﺎر إﻟﻰ اﻟﻧظﺎم ﻋﻠﻰ أﻧﮫ ﺗﺷﻔﯾر ﻏﯾر ﻣﺗﻣﺎﺛل أو ﻣﻔﺗﺎﺣﯾن أو ﻣﻔﺗﺎح ﻋﺎم‬، ‫ﯾﺳﺗﺧدﻣﺎن ﻣﻔﺎﺗﯾﺢ ﻣﺧﺗﻠﻔﺔ‬
• 3. The way in which the plaintext is processed. A block cipher processes the input one
block of elements at a time, producing an output block for each input block. A stream
cipher processes the input elements continuously, producing output one element at a
time, as it goes along. ‫ ﯾﻌﺎﻟﺞ ﺗﺷﻔﯾر اﻟﻛﺗﻠﺔ اﻹدﺧﺎل ﻛﺗﻠﺔ واﺣدة ﻣن اﻟﻌﻧﺎﺻر ﻓﻲ‬.‫ اﻟطرﯾﻘﺔ اﻟﺗﻲ ﺗﺗم ﺑﮭﺎ ﻣﻌﺎﻟﺟﺔ اﻟﻧص اﻟﻌﺎدي‬.3
، ‫ ﯾﻌﺎﻟﺞ ﺗﺷﻔﯾر اﻟدﻓﻖ ﻋﻧﺎﺻر اﻹدﺧﺎل ﺑﺷﻛل ﻣﺳﺗﻣر‬.‫ ﻣﻣﺎ ﯾﻧﺗﺞ ﻋﻧﮫ ﻛﺗﻠﺔ إﺧراج ﻟﻛل ﻛﺗﻠﺔ إدﺧﺎل‬، ‫ﻛل ﻣرة‬
.‫ أﺛﻧﺎء ﺗﻘدﻣﮫ‬، ‫ﻣﻣﺎ ﯾﻧﺗﺞ ﻋﻧﮫ إﺧراج ﻋﻧﺻر واﺣد ﻓﻲ ﻛل ﻣرة‬
9
Cryptography Concepts ‫ﻣﻔﺎھﯾم اﻟﺗﺷﻔﯾر‬

• Substitution: in which each element in the plaintext (bit, letter, group


of bits or letters) is mapped into another element.
.‫ ﺣﯾث ﯾﺗم ﺗﻌﯾﯾن ﻛل ﻋﻧﺻر ﻓﻲ اﻟﻧص اﻟﻌﺎدي )ﺑت أو ﺣرف أو ﻣﺟﻣوﻋﺔ ﻣن اﻟﺑﺗﺎت أو اﻟﺣروف( ﻓﻲ ﻋﻧﺻر آﺧر‬:‫اﻻﺳﺗﺑدال‬

• Permutation: is the transposition, a sequence of plaintext elements is


replaced by a permutation of that sequence.
.‫ ﯾﺗم اﺳﺗﺑدال ﺳﻠﺳﻠﺔ ﻣن ﻋﻧﺎﺻر اﻟﻧص اﻟﻌﺎدي ﺑﺗﺑدﯾل ھذا اﻟﺗﺳﻠﺳل‬، ‫ ھو اﻟﺗﺑدﯾل‬:‫اﻟﺗﻘﻠﯾب‬
• Transposition, in which elements in the plaintext are rearranged. The
fundamental requirement is that no information be lost (i.e., that all
operations are reversible).
‫ اﻟﺷرط اﻷﺳﺎﺳﻲ ھو ﻋدم ﻓﻘدان أي ﻣﻌﻠوﻣﺎت )أي أن‬.‫ ﺣﯾث ﯾﺗم إﻋﺎدة ﺗرﺗﯾب اﻟﻌﻧﺎﺻر ﻓﻲ اﻟﻧص اﻟﻌﺎدي‬، ‫اﻟﺗﺑدﯾل‬
.(‫ﺟﻣﯾﻊ اﻟﻌﻣﻠﯾﺎت ﻗﺎﺑﻠﺔ ﻟﻠﻌﻛس‬
CSE 451 - Computer & Network Security
10
Cryptography Concepts
• Encryption: is the process of hiding, and covering (plaintext)
information, data, communication using cryptography methods.
‫ ھو ﻋﻣﻠﯾﺔ إﺧﻔﺎء وﺗﻐطﯾﺔ )ﻧص ﻋﺎدي( اﻟﻣﻌﻠوﻣﺎت واﻟﺑﯾﺎﻧﺎت‬:‫اﻟﺗﺷﻔﯾر‬
.‫واﻻﺗﺻﺎﻻت ﺑﺎﺳﺗﺧدام طرق اﻟﺗﺷﻔﯾر‬
• Decryption: is the process of uncovering, retrieving the original
message (plaintext), data, information after been encrypted using
cryptographic techniques.
(‫ ھو ﻋﻣﻠﯾﺔ ﻛﺷف واﺳﺗرﺟﺎع اﻟرﺳﺎﻟﺔ اﻷﺻﻠﯾﺔ )ﻧص ﻋﺎدي‬:‫ﻓك اﻟﺗﺷﻔﯾر‬
.‫واﻟﺑﯾﺎﻧﺎت واﻟﻣﻌﻠوﻣﺎت ﺑﻌد ﺗﺷﻔﯾرھﺎ ﺑﺎﺳﺗﺧدام ﺗﻘﻧﯾﺎت اﻟﺗﺷﻔﯾر‬

CSE 451 - Computer & Network Security


11
Cryptography Techniques
‫ﺗﻘﻧﯾﺎت اﻟﺗﺷﻔﯾر‬

• Cryptography itself splits into three main branches:


• Symmetric Algorithms :‫ﯾﻧﻘﺳم اﻟﺗﺷﻔﯾر ﻧﻔﺳﮫ إﻟﻰ ﺛﻼﺛﺔ ﻓروع رﺋﯾﺳﯾﺔ‬
• Asymmetric (or Public-Key) Algorithms ‫اﻟﺧوارزﻣﯾﺎت اﻟﻣﺗﻣﺎﺛﻠﺔ‬
(‫ﺧوارزﻣﯾﺎت ﻏﯾر ﻣﺗﻣﺎﺛﻠﺔ )أو ﻣﻔﺗﺎح ﻋﺎم‬
• Cryptographic Protocols ‫ﺑروﺗوﻛوﻻت اﻟﺗﺷﻔﯾر‬

CSE 451 - Computer & Network Security


12
Cryptography Techniques‫ﺗﻘﻧﯾﺎت اﻟﺗﺷﻔﯾر‬
• Symmetric Algorithms are what many people assume cryptography is
about: two parties have an encryption and decryption method for
which they share a secret key. Using the same key to encrypt and
decrypt the message. :‫اﻟﺧوارزﻣﯾﺎت اﻟﻣﺗﻣﺎﺛﻠﺔ ھﻲ ﻣﺎ ﯾﻔﺗرض اﻟﻛﺛﯾر ﻣن اﻟﻧﺎس أن اﻟﺗﺷﻔﯾر ﯾدور ﺣوﻟﮫ‬
‫ اﺳﺗﺧدام ﻧﻔس‬.‫ﻟدى طرﻓﯾن طرﯾﻘﺔ ﺗﺷﻔﯾر وﻓك ﺗﺷﻔﯾر ﯾﺷﺗرﻛﺎن ﻓﻲ ﻣﻔﺗﺎح ﺳري ﻟﮭﺎ‬
.‫اﻟﻣﻔﺗﺎح ﻟﺗﺷﻔﯾر اﻟرﺳﺎﻟﺔ وﻓك ﺗﺷﻔﯾرھﺎ‬
• All cryptography from ancient times until 1976 was exclusively based
on symmetric methods. Symmetric ciphers are still in widespread use,
especially for data encryption and integrity check of messages.
‫ ﺗﻌﺗﻣد ﺣﺻرﯾﺎ‬1976 ‫ﻛﺎﻧت ﺟﻣﯾﻊ ﻋﻣﻠﯾﺎت اﻟﺗﺷﻔﯾر ﻣن اﻟﻌﺻور اﻟﻘدﯾﻣﺔ ﺣﺗﻰ ﻋﺎم‬
‫ ﺧﺎﺻﺔ‬، ‫ ﻻ ﺗزال اﻷﺻﻔﺎر اﻟﻣﺗﻣﺎﺛﻠﺔ ﻣﺳﺗﺧدﻣﺔ ﻋﻠﻰ ﻧطﺎق واﺳﻊ‬.‫ﻋﻠﻰ طرق ﻣﺗﻣﺎﺛﻠﺔ‬
.‫ﻟﺗﺷﻔﯾر اﻟﺑﯾﺎﻧﺎت واﻟﺗﺣﻘﻖ ﻣن ﺳﻼﻣﺔ اﻟرﺳﺎﺋل‬
CSE 451 - Computer & Network Security
13
Cryptography Techniques
• Asymmetric (or Public-Key) Algorithms In 1976 an entirely different type
of cipher was introduced by Whitfield Diffie, Martin Hellman and Ralph
Merkle. ‫ ﺗم ﺗﻘدﯾم ﻧوع ﻣﺧﺗﻠف ﺗﻣﺎﻣﺎ ﻣن‬، 1976 ‫ﺧوارزﻣﯾﺎت ﻏﯾر ﻣﺗﻣﺎﺛﻠﺔ )أو ﻣﻔﺗﺎح ﻋﺎم( ﻓﻲ ﻋﺎم‬
.‫اﻟﺗﺷﻔﯾر ﺑواﺳطﺔ وﯾﺗﻔﯾﻠد دﯾﻔﻲ وﻣﺎرﺗن ھﯾﻠﻣﺎن وراﻟف ﻣﯾرﻛل‬

• In public-key cryptography, a user possesses a secret key as in symmetric


cryptography but also a public key. Two different keys separately made for
encryption and decryption the message.
.‫ ﯾﻣﺗﻠك اﻟﻣﺳﺗﺧدم ﻣﻔﺗﺎﺣﺎ ﺳرﯾﺎ ﻛﻣﺎ ھو اﻟﺣﺎل ﻓﻲ اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل وﻟﻛن أﯾﺿﺎ ﻣﻔﺗﺎﺣﺎ ﻋﺎﻣﺎ‬، ‫ﻓﻲ ﺗﺷﻔﯾر اﻟﻣﻔﺗﺎح اﻟﻌﺎم‬
.‫ﻣﻔﺗﺎﺣﺎن ﻣﺧﺗﻠﻔﺎن ﻣﺻﻧوﻋﺎن ﺑﺷﻛل ﻣﻧﻔﺻل ﻟﺗﺷﻔﯾر اﻟرﺳﺎﻟﺔ وﻓك ﺗﺷﻔﯾرھﺎ‬
• Asymmetric algorithms can be used for applications such as digital
signatures and key establishment, and also for classical data encryption.
‫ﯾﻣﻛن اﺳﺗﺧدام اﻟﺧوارزﻣﯾﺎت ﻏﯾر اﻟﻣﺗﻣﺎﺛﻠﺔ ﻟﺗطﺑﯾﻘﺎت ﻣﺛل اﻟﺗوﻗﯾﻌﺎت‬
.‫ وﻛذﻟك ﻟﺗﺷﻔﯾر اﻟﺑﯾﺎﻧﺎت اﻟﻛﻼﺳﯾﻛﻲ‬، ‫اﻟرﻗﻣﯾﺔ وإﻧﺷﺎء اﻟﻣﻔﺎﺗﯾﺢ‬ 14
Cryptography Techniques
• Cryptographic Protocols Roughly speaking, crypto protocols deal with
the application of cryptographic algorithms.
• Symmetric and asymmetric algorithms can be viewed as building
blocks with which applications such as secure Internet
communication can be realized. The Transport Layer Security (TLS)
scheme, which is used in every Web browser, is an example of a
cryptographic protocol. ‫ ﺗﺗﻌﺎﻣل ﺑروﺗوﻛوﻻت اﻟﺗﺷﻔﯾر ﻣﻊ ﺗطﺑﯾﻖ‬، ‫ﺑروﺗوﻛوﻻت اﻟﺗﺷﻔﯾر ﺑﺷﻛل ﺗﻘرﯾﺑﻲ‬
.‫ﺧوارزﻣﯾﺎت اﻟﺗﺷﻔﯾر‬
‫ﯾﻣﻛن اﻟﻧظر إﻟﻰ اﻟﺧوارزﻣﯾﺎت اﻟﻣﺗﻣﺎﺛﻠﺔ وﻏﯾر اﻟﻣﺗﻣﺎﺛﻠﺔ ﻋﻠﻰ أﻧﮭﺎ ﻟﺑﻧﺎت ﺑﻧﺎء ﯾﻣﻛن‬
‫ ﯾﻌد ﻣﺧطط أﻣﺎن‬.‫ﻣن ﺧﻼﻟﮭﺎ ﺗﺣﻘﯾﻖ ﺗطﺑﯾﻘﺎت ﻣﺛل اﻻﺗﺻﺎل اﻵﻣن ﻋﺑر اﻹﻧﺗرﻧت‬
TLS‫طﺑﻘﺔ اﻟﻧﻘل‬
.‫ ﻣﺛﺎﻻ ﻋﻠﻰ ﺑروﺗوﻛول اﻟﺗﺷﻔﯾر‬، ‫ اﻟﻣﺳﺗﺧدم ﻓﻲ ﻛل ﻣﺳﺗﻌرض وﯾب‬،
CSE 451 - Computer & Network Security
15
What is Symmetric Encryption?
‫ﻣﺎ ھو اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل؟‬

CSE 451 - Computer & Network Security


16
Symmetric Encryption
‫اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل‬

• Symmetric encryption, also referred to as conventional encryption or


single-key, symmetric-key, and secret-key encryption was the only type of
encryption in use prior to the development of public-key encryption in the
1970s. ‫ اﻟذي ﯾﺷﺎر إﻟﯾﮫ أﯾﺿﺎ ﺑﺎﺳم اﻟﺗﺷﻔﯾر اﻟﺗﻘﻠﯾدي أو ﺗﺷﻔﯾر اﻟﻣﻔﺗﺎح‬، ‫اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل‬
‫ وﺗﺷﻔﯾر اﻟﻣﻔﺗﺎح اﻟﺳري ھو اﻟﻧوع اﻟوﺣﯾد ﻣن‬، ‫ واﻟﻣﻔﺗﺎح اﻟﻣﺗﻣﺎﺛل‬، ‫اﻟواﺣد‬
.‫اﻟﺗﺷﻔﯾر اﻟﻣﺳﺗﺧدم ﻗﺑل ﺗطوﯾر ﺗﺷﻔﯾر اﻟﻣﻔﺗﺎح اﻟﻌﺎم ﻓﻲ ﺳﺑﻌﯾﻧﯾﺎت اﻟﻘرن اﻟﻌﺷرﯾن‬
• Definition: Symmetric encryption uses a single key to encrypt and decrypt
information. Sender and receiver are using the same key to encrypt and
decrypt the message. ‫ ﯾﺳﺗﺧدم‬.‫ ﯾﺳﺗﺧدم اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل ﻣﻔﺗﺎﺣﺎ واﺣدا ﻟﺗﺷﻔﯾر اﻟﻣﻌﻠوﻣﺎت وﻓك ﺗﺷﻔﯾرھﺎ‬:‫اﻟﺗﻌرﯾف‬
.‫اﻟﻣرﺳل واﻟﻣﺳﺗﻘﺑل ﻧﻔس اﻟﻣﻔﺗﺎح ﻟﺗﺷﻔﯾر اﻟرﺳﺎﻟﺔ وﻓك ﺗﺷﻔﯾرھﺎ‬

• Symmetric cryptographic schemes are also referred to as symmetric-key,


secret-key, and single-key or conventional encryption.
‫ﯾﺷﺎر إﻟﻰ ﻣﺧططﺎت اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛﻠﺔ أﯾﺿﺎ ﺑﺎﺳم اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل ﻟﻠﻣﻔﺗﺎح‬
.‫اﻟﻣﺗﻣﺎﺛل واﻟﻣﻔﺗﺎح اﻟﺳري واﻟﻣﻔﺗﺎح اﻟﻔردي أو اﻟﺗﻘﻠﯾدي‬
17
How to employ symmetric encryption?
‫ﻛﯾف ﺗﺳﺗﺧدم اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل؟‬

Example:
Hacker

1.1

CSE 451 - Computer & Network Security


18
Communication over
‫اﻻﺗﺻﺎل ﻋﺑر ﻗﻧﺎة ﻏﯾر آﻣﻧﺔ‬
insecure channel
• Example:
• There are two users, Alice and Bob, who want to communicate over
an insecure channel (Internet, mobile phones or wireless LAN
communication, etc..).
‫ ﯾرﯾدان اﻟﺗواﺻل ﻋﺑر ﻗﻧﺎة ﻏﯾر آﻣﻧﺔ )اﻹﻧﺗرﻧت أو‬، ‫ أﻟﯾس وﺑوب‬، ‫ھﻧﺎك ﻣﺳﺗﺧدﻣﺎن‬
.(‫ وﻣﺎ إﻟﻰ ذﻟك‬، ‫اﻟﮭواﺗف اﻟﻣﺣﻣوﻟﺔ أو اﺗﺻﺎﻻت اﻟﺷﺑﻛﺔ اﻟﻣﺣﻠﯾﺔ اﻟﻼﺳﻠﻛﯾﺔ‬

• The actual problem starts with the bad guy “hacker” who has access
to the channel, for instance, by hacking into an Internet router or by
listening to the radio signals of a Wi-Fi communication. This type of
unauthorized listening is called eavesdropping.
‫ ﻋن طرﯾﻖ‬، ‫ ﻋﻠﻰ ﺳﺑﯾل اﻟﻣﺛﺎل‬، ‫ﺗﺑدأ اﻟﻣﺷﻛﻠﺔ اﻟﻔﻌﻠﯾﺔ ﻣﻊ "اﻟﻘراﺻﻧﺔ" اﻟﺷرﯾرة اﻟﺗﻲ ﻟدﯾﮭﺎ ﺣﻖ اﻟوﺻول إﻟﻰ اﻟﻘﻧﺎة‬
‫اﺧﺗراق ﺟﮭﺎز ﺗوﺟﯾﮫ اﻹﻧﺗرﻧت أو ﻋن طرﯾﻖ اﻻﺳﺗﻣﺎع إﻟﻰ إﺷﺎرات اﻟرادﯾو ﻻﺗﺻﺎل‬Wi-Fi. ‫ھذا اﻟﻧوع ﻣن اﻻﺳﺗﻣﺎع‬
.‫ﻏﯾر اﻟﻣﺻرح ﺑﮫ ﯾﺳﻣﻰ اﻟﺗﻧﺻت‬
19
How to secure a communication?
‫ﻛﯾﻔﯾﺔ ﺗﺄﻣﯾن اﻻﺗﺻﺎل؟‬

CSE 451 - Computer & Network Security


20
Symmetric Encryption
‫اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل‬
Hacker

1.2
CSE 451 - Computer & Network Security
21
Symmetric Encryption

1.3
CSE 451 - Computer & Network Security
22
Symmetric Encryption
• The variables x, y and k in Fig. 1.2 & 1.3 are important in cryptography
and have special names:
• x is called plaintext or cleartext,
• y is called ciphertext,
• k is called the key,
• the set of all possible keys is called the key space.

CSE 451 - Computer & Network Security


23
Symmetric Encryption
• With the message X and the encryption key K as input, the encryption
algorithm forms the ciphertext Y = [Y1, Y2, c , YN]. We can write this
as
• Y = E(K, X)
• Y is produced by using encryption algorithm E as a function of the
plaintext X, with the specific function determined by the value of the
key K.

CSE 451 - Computer & Network Security


24
Symmetric Encryption
• The intended receiver, in possession of the key, is able to invert the
transformation:
• X = D(K, Y)
• The encryption (E) and decryption (D) algorithms.

CSE 451 - Computer & Network Security


25
Symmetric Encryption - Definitions
• Plaintext: This is the original intelligible message or data that is fed into the
algorithm as input. ‫ ھذه ھﻲ اﻟرﺳﺎﻟﺔ أو اﻟﺑﯾﺎﻧﺎت اﻷﺻﻠﯾﺔ اﻟواﺿﺣﺔ اﻟﺗﻲ ﯾﺗم إدﺧﺎﻟﮭﺎ ﻓﻲ‬:‫ﻧص ﻋﺎدي‬
.‫اﻟﺧوارزﻣﯾﺔ ﻛﻣدﺧﻼت‬

• Encryption algorithm: The encryption algorithm performs various


substitutions and transformations on the plaintext.
‫ ﺗﻘوم ﺧوارزﻣﯾﺔ اﻟﺗﺷﻔﯾر ﺑﺈﺟراء اﻟﻌدﯾد ﻣن اﻟﺑداﺋل واﻟﺗﺣوﯾﻼت‬:‫ﺧوارزﻣﯾﺔ اﻟﺗﺷﻔﯾر‬
.‫ﻋﻠﻰ اﻟﻧص اﻟﻌﺎدي‬
• Secret key: The secret key is also input to the encryption algorithm. The
key is a value independent of the plaintext and of the algorithm. The
algorithm will pro- duce a different output depending on the specific key
being used at the time. The exact substitutions and transformations
performed by the algorithm depend on the key.
.‫ اﻟﻣﻔﺗﺎح ھو ﻗﯾﻣﺔ ﻣﺳﺗﻘﻠﺔ ﻋن اﻟﻧص اﻟﻌﺎدي واﻟﺧوارزﻣﯾﺔ‬.‫ اﻟﻣﻔﺗﺎح اﻟﺳري ھو أﯾﺿﺎ إدﺧﺎل إﻟﻰ ﺧوارزﻣﯾﺔ اﻟﺗﺷﻔﯾر‬:‫اﻟﻣﻔﺗﺎح اﻟﺳري‬
‫ ﺗﻌﺗﻣد اﻟﺑداﺋل واﻟﺗﺣوﯾﻼت اﻟدﻗﯾﻘﺔ اﻟﺗﻲ ﺗﻘوم‬.‫ﺳﺗﻧﺗﺞ اﻟﺧوارزﻣﯾﺔ ﻣﺧرﺟﺎت ﻣﺧﺗﻠﻔﺔ اﻋﺗﻣﺎدا ﻋﻠﻰ اﻟﻣﻔﺗﺎح اﻟﻣﺣدد اﻟﻣﺳﺗﺧدم ﻓﻲ ذﻟك اﻟوﻗت‬
.‫ﺑﮭﺎ اﻟﺧوارزﻣﯾﺔ ﻋﻠﻰ اﻟﻣﻔﺗﺎح‬ 26
Symmetric Encryption - Definitions
• Ciphertext: This is the scrambled message produced as output. It
depends on the plaintext and the secret key. For a given message, two
different keys will produce two different ciphertexts. The ciphertext is
an apparently random stream of data and, as it stands, is
unintelligible. ‫ ﯾﻌﺗﻣد ذﻟك‬.‫ ھذه ھﻲ اﻟرﺳﺎﻟﺔ اﻟﻣﺧﻠوطﺔ اﻟﺗﻲ ﺗم إﻧﺗﺎﺟﮭﺎ ﻛﺈﺧراج‬:‫اﻟﻧص اﻟﻣﺷﻔر‬
‫ ﺳﯾﻧﺗﺞ ﻣﻔﺗﺎﺣﺎن‬، ‫ ﺑﺎﻟﻧﺳﺑﺔ ﻟرﺳﺎﻟﺔ ﻣﻌﯾﻧﺔ‬.‫ﻋﻠﻰ اﻟﻧص اﻟﻌﺎدي واﻟﻣﻔﺗﺎح اﻟﺳري‬
‫ اﻟﻧص اﻟﻣﺷﻔر ھو دﻓﻖ ﻋﺷواﺋﻲ ﻋﻠﻰ ﻣﺎ ﯾﺑدو‬.‫ﻣﺧﺗﻠﻔﺎن ﻧﺻﯾن ﻣﺷﻔرﯾن ﻣﺧﺗﻠﻔﯾن‬
.‫ ﻓﮭو ﻏﯾر ﻣﻔﮭوم‬، ‫ وﻛﻣﺎ ھو اﻟﺣﺎل‬، ‫ﻣن اﻟﺑﯾﺎﻧﺎت‬
• Decryption algorithm: This is essentially the encryption algorithm run
in reverse. It takes the ciphertext and the secret key and produces the
original plaintext. ‫ ھذه ھﻲ ﻓﻲ اﻷﺳﺎس ﺧوارزﻣﯾﺔ اﻟﺗﺷﻔﯾر اﻟﺗﻲ ﺗﻌﻣل ﻓﻲ‬:‫ﺧوارزﻣﯾﺔ ﻓك اﻟﺗﺷﻔﯾر‬
‫ ﯾﺄﺧذ اﻟﻧص اﻟﻣﺷﻔر واﻟﻣﻔﺗﺎح اﻟﺳري وﯾﻧﺗﺞ اﻟﻧص اﻟﻌﺎدي‬.‫اﻻﺗﺟﺎه اﻟﻣﻌﺎﻛس‬
.‫اﻷﺻﻠﻲ‬

27
Characteristics and Limitations of Symmetric
Encryption ‫ﺧﺻﺎﺋص وﻗﯾود اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل‬ ‫وﻟﻛن اﻟﻣﺛﺎل اﻟذي ﺗﻌﻣل ﻓﯾﮫ ھذه اﻟطرﯾﻘﺔ ﺑﺷﻛل ﺟﯾد ھو اﻟﻣﻔﺎﺗﯾﺢ اﻟﻣﺷﺗرﻛﺔ‬
‫ﻣﺳﺑﻘﺎ‬Wi-Fi (WPA) ‫اﻟﻣﺳﺗﺧدﻣﺔ ﻓﻲ ﺗﺷﻔﯾر اﻟوﺻول اﻟﻣﺣﻣﻲ ﺑﺷﺑﻛﺔ‬
‫ﻓﻲ اﻟﻼﺳﻠﻛﻲ‬
• If we have a strong encryption algorithm, the ciphertext will look like
random bits ‫ ﻓﺳﯾﺑدو اﻟﻧص اﻟﻣﺷﻔر ﻣﺛل اﻟﺑﺗﺎت اﻟﻌﺷواﺋﯾﺔ‬، ‫إذا ﻛﺎﻧت ﻟدﯾﻧﺎ ﺧوارزﻣﯾﺔ ﺗﺷﻔﯾر ﻗوﯾﺔ‬

• The system needs a secure channel for distribution of the key between
Alice and Bob. .‫ﯾﺣﺗﺎج اﻟﻧظﺎم إﻟﻰ ﻗﻧﺎة آﻣﻧﺔ ﻟﺗوزﯾﻊ اﻟﻣﻔﺗﺎح ﺑﯾن أﻟﯾس وﺑوب‬
• For example: A human who is transporting the key in a wallet between
Alice and Bob. This is, of course, a somewhat cumbersome method.
.‫ طرﯾﻘﺔ ﻣرھﻘﺔ إﻟﻰ ﺣد ﻣﺎ‬، ‫ ﺑﺎﻟطﺑﻊ‬، ‫ ھذه‬.‫ إﻧﺳﺎن ﯾﻧﻘل اﻟﻣﻔﺗﺎح ﻓﻲ ﻣﺣﻔظﺔ ﺑﯾن أﻟﯾس وﺑوب‬:‫ﻋﻠﻰ ﺳﺑﯾل اﻟﻣﺛﺎل‬
• But an example where this method works nicely is the pre-shared keys
used in Wi-Fi Protected Access (WPA) encryption in wireless
• The key has only to be transmitted once between Alice and Bob and can
then be used for securing many subsequent communications.
.‫ﯾﺟب إرﺳﺎل اﻟﻣﻔﺗﺎح ﻣرة واﺣدة ﻓﻘط ﺑﯾن أﻟﯾس وﺑوب وﯾﻣﻛن اﺳﺗﺧداﻣﮫ ﺑﻌد ذﻟك ﻟﺗﺄﻣﯾن اﻟﻌدﯾد ﻣن اﻻﺗﺻﺎﻻت اﻟﻼﺣﻘﺔ‬
CSE 451 - Computer & Network Security
28
Characteristics and Limitations of Symmetric
Encryption
• Both the encryption and the decryption algorithms are publicly
known ‫ﻛل ﻣن ﺧوارزﻣﯾﺎت اﻟﺗﺷﻔﯾر وﻓك اﻟﺗﺷﻔﯾر ﻣﻌروﻓﺔ ﻟﻠﺟﻣﮭور‬

• Then if a hacker gets hold of the key, he can easily decrypt the
message since the algorithm is publicly known.
‫ ﻓﯾﻣﻛﻧﮫ ﺑﺳﮭوﻟﺔ ﻓك ﺗﺷﻔﯾر اﻟرﺳﺎﻟﺔ ﻷن‬، ‫ﺛم إذا ﺣﺻل أﺣد اﻟﻣﺗﺳﻠﻠﯾن ﻋﻠﻰ اﻟﻣﻔﺗﺎح‬
.‫اﻟﺧوارزﻣﯾﺔ ﻣﻌروﻓﺔ ﻟﻠﺟﻣﮭور‬

CSE 451 - Computer & Network Security


29
Characteristics and Limitations of Symmetric
Encryption

• Both sender and receiver use the same key .


• Hence, the main important things to keep system secure are:
• The key must be kept secret.
• The key must be transmitted securely.
. ‫ﯾﺳﺗﺧدم ﻛل ﻣن اﻟﻣرﺳل واﻟﻣﺳﺗﻘﺑل ﻧﻔس اﻟﻣﻔﺗﺎح‬
:‫ ﻓﺈن اﻷﺷﯾﺎء اﻟرﺋﯾﺳﯾﺔ اﻟﻣﮭﻣﺔ ﻟﻠﺣﻔﺎظ ﻋﻠﻰ أﻣﺎن اﻟﻧظﺎم ھﻲ‬، ‫وﺑﺎﻟﺗﺎﻟﻲ‬
.‫ﯾﺟب أن ﯾﺑﻘﻰ اﻟﻣﻔﺗﺎح ﺳرﯾﺎ‬
.‫ﯾﺟب ﻧﻘل اﻟﻣﻔﺗﺎح ﺑﺷﻛل آﻣن‬

CSE 451 - Computer & Network Security


30
Symmetric Encryption:
1. The Substitution Cipher
(‫ﺗﺷﻔﯾر ﻗﯾﺻر )ﺗﺷﻔﯾر اﻟﺗﺣول‬
.‫ ﻟﺗﺷﻔﯾر اﻻﺳﺗﺑدال ﻛﺎن ﻣن ﻗﺑل ﯾوﻟﯾوس ﻗﯾﺻر‬، ‫ وأﺑﺳط‬، ‫أﻗدم اﺳﺗﺧدام ﻣﻌروف‬
‫ﯾﺗﺿﻣن ﺗﺷﻔﯾر ﻗﯾﺻر اﺳﺗﺑدال ﻛل ﺣرف ﻣن اﻟﺣروف اﻷﺑﺟدﯾﺔ ﺑﺎﻟﺣرف اﻟذي ﯾﻘف‬
Caesar Cipher (Shift Cipher) .‫ﺛﻼﺛﺔ أﻣﺎﻛن أﺳﻔل اﻷﺑﺟدﯾﺔ‬

• The earliest known, and the simplest, use of a substitution cipher was
by Julius Caesar. The Caesar cipher involves replacing each letter of
the alphabet with the letter standing three places further down the
alphabet.
• Substitution = Replacement
• Plaintext: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
• Cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
CSE 451 - Computer & Network Security
31
Caesar Cipher - Substitution Cipher
• For example,

• Plaintext: meet me after the toga party


• Cipher: PHHW PH DIWHU WKH WRJD SDUWB

• Using the flowing structure


• Plaintext: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
• Cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
CSE 451 - Computer & Network Security
32
Caesar Cipher - Substitution Cipher

Assign a numerical equivalent to each letter:


Encoding of letters for the shift cipher

CSE 451 - Computer & Network Security


33
Caesar Cipher - Substitution Cipher
• Then the algorithm can be expressed as follows. For each plaintext
letter p, substitute the ciphertext letter C:

C = E(3,p) = (p + 3)mod26

CSE 451 - Computer & Network Security


34
Caesar Cipher - Substitution Cipher
• A shift may be of any amount, ، ‫ﻗد ﯾﻛون اﻟﺗﺣول ﺑﺄي ﻣﺑﻠﻎ‬
:‫ﺑﺣﯾث ﺗﻛون ﺧوارزﻣﯾﺔ ﺗﺷﻔﯾر ﻗﯾﺻر اﻟﻌﺎﻣﺔ ھﻲ‬
so that the general Caesar encryption algorithm is:
C = E(k,p) = (p + k)mod26

• The decryption algorithm is simply ‫ﺧوارزﻣﯾﺔ ﻓك اﻟﺗﺷﻔﯾر ھﻲ ﺑﺑﺳﺎطﺔ‬

p = D(k,C) = (C - k)mod26

• Note: k takes on a value in the range 1 to 25.


CSE 451 - Computer & Network Security
35
Brute-Force Cryptanalysis of Caesar Cipher

Brute-force cryptanalysis is easily


performed on Caesar Cipher
‫ﯾﺗم إﺟراء ﺗﺣﻠﯾل اﻟﺷﻔرات ﺑﺎﻟﻘوة اﻟﻐﺎﺷﻣﺔ ﺑﺳﮭوﻟﺔ ﻋﻠﻰ ﺗﺷﻔﯾر ﻗﯾﺻر‬

CSE 451 - Computer & Network Security


36
Brute-Force Cryptanalysis of Caesar Cipher
‫ﺗﺣﻠﯾل ﺗﺷﻔﯾر اﻟﻘوة اﻟﻐﺎﺷﻣﺔ ﻟﺗﺷﻔﯾر ﻗﯾﺻر‬

Three important characteristics of this problem enabled us to use a


brute-force cryptanalysis:
:‫ﺛﻼث ﺧﺻﺎﺋص ﻣﮭﻣﺔ ﻟﮭذه اﻟﻣﺷﻛﻠﺔ ﻣﻛﻧﺗﻧﺎ ﻣن اﺳﺗﺧدام ﺗﺣﻠﯾل ﺗﺷﻔﯾر اﻟﻘوة اﻟﻐﺎﺷﻣﺔ‬

1. The encryption and decryption algorithms are known.


2. There are only 25 keys to try.
3. The language of the plaintext is known and easily recognizable.
.‫ ﺧوارزﻣﯾﺎت اﻟﺗﺷﻔﯾر وﻓك اﻟﺗﺷﻔﯾر ﻣﻌروﻓﺔ‬.1
.‫ ﻣﻔﺗﺎﺣﺎ ﻟﻠﻣﺣﺎوﻟﺔ‬25 ‫ ﻻ ﯾوﺟد ﺳوى‬.2
.‫ ﻟﻐﺔ اﻟﻧص اﻟﻌﺎدي ﻣﻌروﻓﺔ وﯾﻣﻛن اﻟﺗﻌرف ﻋﻠﯾﮭﺎ ﺑﺳﮭوﻟﺔ‬.3

CSE 451 - Computer & Network Security


37
Monoalphabetic Ciphers
‫اﻷﺻﻔﺎر أﺣﺎدﯾﺔ اﻷﺑﺟدﯾﺔ‬
Monoalphabetic Ciphers
• A dramatic increase in the key space can be achieved by allowing an
arbitrary substitution. ‫ﯾﻣﻛن ﺗﺣﻘﯾﻖ زﯾﺎدة ﻛﺑﯾرة ﻓﻲ اﻟﻣﺳﺎﺣﺔ اﻟرﺋﯾﺳﯾﺔ ﻣن ﺧﻼل اﻟﺳﻣﺎح ﺑﺎﺳﺗﺑدال‬
.‫ﺗﻌﺳﻔﻲ‬
• A permutation of a finite set of elements S is an ordered sequence of
all the elements of S, with each element appearing exactly once.
‫اﻟﺗﻘﻠﯾب ﻟﻣﺟﻣوﻋﺔ ﻣﻧﺗﮭﯾﺔ ﻣن اﻟﻌﻧﺎﺻر‬S ‫ھو ﺗﺳﻠﺳل ﻣرﺗب ﻟﺟﻣﯾﻊ ﻋﻧﺎﺻر‬S ‫ ﻣﻊ‬،
• For example, .‫ظﮭور ﻛل ﻋﻧﺻر ﻣرة واﺣدة ﺑﺎﻟﺿﺑط‬
• if S = {a, b, c}, there are six permutations of S:
• abc, acb, bac, bca, cab, cba

CSE 451 - Computer & Network Security


38
Monoalphabetic
‫اﻷﺻﻔﺎر أﺣﺎدﯾﺔ اﻷﺑﺟدﯾﺔ‬
Ciphers
• There are n! permutations of a set of n elements, because the first element can be
chosen in one of n ways, the second in n - 1 ways, the third in n - 2 ways, and so on.

• Recall the assignment for the Caesar cipher:


• Plaintext: ABCDEFGHIJKLMNOPQRSTUVWXYZ
• Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC

• If, instead, the “cipher” line can be any permutation of the 26 alphabetic characters, then
there are 26! or greater than 4 * 1026 possible keys. This would seem to stop brute-force
techniques for cryptanalysis.

• But another line of attack. If the cryptanalyst knows the nature of the plaintext then the
analyst can exploit the frequency of the letters.
.‫ﻓﯾﻣﻛن ﻟﻠﻣﺣﻠل اﺳﺗﻐﻼل ﺗﻛرار اﻟﺣروف‬ ، ‫ إذا ﻛﺎن ﻣﺣﻠل اﻟﺗﺷﻔﯾر ﯾﻌرف طﺑﯾﻌﺔ اﻟﻧص اﻟﻌﺎدي‬.‫ﻟﻛن ﺧط ھﺟوم آﺧر‬
CSE 451 - Computer & Network Security
39
Monoalphabetic Ciphers - Cryptanalysis
• The relative frequency of the letters can be determined and
compared to a standard frequency distribution for English to break a
cipher ‫ﯾﻣﻛن ﺗﺣدﯾد اﻟﺗردد اﻟﻧﺳﺑﻲ ﻟﻠﺣروف وﻣﻘﺎرﻧﺗﮫ ﺑﺗوزﯾﻊ اﻟﺗردد اﻟﻘﯾﺎﺳﻲ ﻟﻠﻐﺔ اﻹﻧﺟﻠﯾزﯾﺔ ﻟﻛﺳر اﻟﺷﻔرات‬

CSE 451 - Computer & Network Security


40
Monoalphabetic Ciphers - Cryptanalysis
• The Relative Frequency of Letters in English Text
‫اﻟﺗﻛرار اﻟﻧﺳﺑﻲ ﻟﻠﺣروف ﻓﻲ اﻟﻧص اﻹﻧﺟﻠﯾزي‬

CSE 451 - Computer & Network Security


41
Playfair Cipher
• The best-known multiple-letter encryption cipher is the Playfair
• The Playfair algorithm is based on the use of a 5 * 5 matrix of letters
constructed using a keyword.
Playfair ‫أﺷﮭر ﺗﺷﻔﯾر ﺗﺷﻔﯾر ﻣﺗﻌدد اﻷﺣرف ھو‬
Playfair ‫ﺗﻌﺗﻣد ﺧوارزﻣﯾﺔ‬

‫ ﻣن اﻟﺣروف اﻟﺗﻲ ﺗم‬5 * 5 ‫ﻋﻠﻰ اﺳﺗﺧدام ﻣﺻﻔوﻓﺔ‬


.‫إﻧﺷﺎؤھﺎ ﺑﺎﺳﺗﺧدام ﻛﻠﻣﺔ رﺋﯾﺳﯾﺔ‬

CSE 451 - Computer & Network Security


42
Playfair Cipher
.‫ اﻟﻛﻠﻣﺔ اﻟرﺋﯾﺳﯾﺔ ھﻲ اﻟﻣﻠﻛﯾﺔ‬:‫ﻋﻠﻰ ﺳﺑﯾل اﻟﻣﺛﺎل‬
• For example: The keyword is monarchy.
• The matrix is constructed by filling in
the letters of the keyword (minus
duplicates).
.(‫ﯾﺗم إﻧﺷﺎء اﻟﻣﺻﻔوﻓﺔ ﻋن طرﯾﻖ ﻣلء أﺣرف اﻟﻛﻠﻣﺔ اﻷﺳﺎﺳﯾﺔ )ﻧﺎﻗص اﻟﺗﻛرارات‬
• From left to right and from top to
bottom.
.‫ﻣن اﻟﯾﺳﺎر إﻟﻰ اﻟﯾﻣﯾن وﻣن أﻋﻠﻰ إﻟﻰ أﺳﻔل‬
• Then filling in the remainder of the
matrix with the remaining letters in
alphabetic order. The letters I and J
count as one letter. ‫ اﻟﺣرﻓﺎن‬.‫ﺛم اﻣﻸ ﻣﺎ ﺗﺑﻘﻰ ﻣن اﻟﻣﺻﻔوﻓﺔ ﺑﺎﻷﺣرف اﻟﻣﺗﺑﻘﯾﺔ ﺑﺎﻟﺗرﺗﯾب اﻷﺑﺟدي‬I ‫و‬J
.‫ﯾﻌدان ﻛﺣرف واﺣد‬
CSE 451 - Computer & Network Security
43
Playfair Cipher
• Plaintext is encrypted two letters at a time, according to the following
rules Plaintext: balloon ‫ ﺑﺎﻟون‬:‫ وﻓﻘﺎ ﻟﻠﻘواﻋد اﻟﺗﺎﻟﯾﺔ ﻧص ﻋﺎدي‬، ‫ﯾﺗم ﺗﺷﻔﯾر اﻟﻧص اﻟﻌﺎدي ﺣرﻓﯾن ﻓﻲ وﻗت واﺣد‬
• Repeating plaintext letters that are in the same pair are separated
with a filler letter, such as x, so that balloon would be treated as ba lx
Playfair Cipher:
lo on.

، ‫ﯾﺗم ﻓﺻل أﺣرف اﻟﻧص اﻟﻌﺎدي اﻟﻣﺗﻛررة اﻟﻣوﺟودة ﻓﻲ ﻧﻔس اﻟزوج ﺑﺣرف ﺣﺷو‬
x ، ‫ﻣﺛل‬
ba lx lo on. ‫ﺑﺣﯾث ﯾﺗم اﻟﺗﻌﺎﻣل ﻣﻊ ھذا اﻟﺑﺎﻟون ﻋﻠﻰ أﻧﮫ‬

CSE 451 - Computer & Network Security


44
Playfair Cipher

• Example:
AR is encrypted as RM
• Rule: two plaintext letters that fall
in the same row of the matrix are
each replaced by the letter to the
right, with the first element of the
row circularly following the last.
AR , RM ‫ﯾﺗم ﺗﺷﻔﯾر‬
‫ ﯾﺗم اﺳﺗﺑدال ﺣرﻓﯾن ﻋﺎدﯾﯾن ﯾﻘﻌﺎن ﻓﻲ ﻧﻔس اﻟﺻف ﻣن اﻟﻣﺻﻔوﻓﺔ ﺑﺎﻟﺣرف‬:‫اﻟﻘﺎﻋدة‬
‫ ﻣﻊ وﺟود اﻟﻌﻧﺻر اﻷول ﻣن اﻟﺻف ﺑﺷﻛل داﺋري ﺑﻌد‬، ‫اﻟﻣوﺟود ﻋﻠﻰ اﻟﯾﻣﯾن‬
.‫اﻷﺧﯾر‬

CSE 451 - Computer & Network Security


45
Playfair Cipher

• Example:
MU is encrypted as CM
• Rule: Two plaintext letters that
fall in the same column are each
replaced by the letter beneath,
with the top element of the
column circularly following the
last.

CSE 451 - Computer & Network Security


46
Playfair Cipher

• Example:
• HS is encrypted as BP
• Rule: each plaintext letter in a pair is
replaced by the letter that lies in its
own row and the column occupied by
the other plaintext letter.
Thus, HS becomes BP and EA becomes
IM (or JM, as the encipherer wishes).

CSE 451 - Computer & Network Security


47
Playfair Cipher - Cryptanalysis
• The Playfair cipher is a great advance over simple monoalphabetic
ciphers. For one thing, whereas there are only 26 letters, there are 26
* 26 = 676 digrams, so that identification of individual digrams is
more difficult.

• Furthermore, the relative frequencies of individual letters exhibit a


much greater range than that of digrams, making frequency analysis
much more difficult. For these reasons, the Playfair cipher was for a
long time considered unbreakable.

CSE 451 - Computer & Network Security


48
Playfair Cipher- Cryptanalysis
• It was used as the standard field system by the British Army in World
War I and still enjoyed considerable use by the U.S. Army and other
Allied forces during World War II.
‫ﺗم اﺳﺗﺧداﻣﮫ ﻛﻧظﺎم ﻣﯾداﻧﻲ ﻗﯾﺎﺳﻲ ﻣن ﻗﺑل اﻟﺟﯾش اﻟﺑرﯾطﺎﻧﻲ ﻓﻲ اﻟﺣرب اﻟﻌﺎﻟﻣﯾﺔ‬
‫اﻷوﻟﻰ وﻻ ﯾزال ﯾﺗﻣﺗﻊ ﺑﺎﺳﺗﺧدام ﻛﺑﯾر ﻣن ﻗﺑل اﻟﺟﯾش اﻷﻣرﯾﻛﻲ وﻗوات اﻟﺣﻠﻔﺎء‬
.‫اﻷﺧرى ﺧﻼل اﻟﺣرب اﻟﻌﺎﻟﻣﯾﺔ اﻟﺛﺎﻧﯾﺔ‬
• However, playfair cipher is relatively easy to break, because it still
leaves much of the structure of the plaintext language intact. A few
hundred letters of ciphertext are generally sufficient.
playfair ‫ ﻣن اﻟﺳﮭل ﻧﺳﺑﯾﺎ ﻛﺳر ﺗﺷﻔﯾر‬، ‫وﻣﻊ ذﻟك‬
‫ ﻷﻧﮫ ﻻ ﯾزال ﯾﺗرك اﻟﻛﺛﯾر ﻣن‬،
‫ ﺑﺿﻊ ﻣﺋﺎت ﻣن أﺣرف اﻟﻧص اﻟﻣﺷﻔر ﻛﺎﻓﯾﺔ ﺑﺷﻛل‬.‫ﺑﻧﯾﺔ ﻟﻐﺔ اﻟﻧص اﻟﻌﺎدي ﺳﻠﯾﻣﺔ‬
.‫ﻋﺎم‬
CSE 451 - Computer & Network Security
49
Playfair Cipher - Cryptanalysis
• Relative
Frequency of
Occurrence of
Letters
‫اﻟﺗﻛرار‬
‫اﻟﻧﺳﺑﻲ‬
‫ﻟﺣدوث‬
‫اﻟﺣروف‬

CSE 451 - Computer & Network Security


50
Vigenère Cipher
• One of the simplest, Vigenère.
polyalphabetic ciphers is the Vigenère cipher.
‫واﺣدة ﻣن أﺑﺳط اﻷﺻﻔﺎر ﻣﺗﻌددة اﻷﺑﺟدﯾﺔ ھﻲ ﺷﻔرة‬
• The set of related monoalphabetic substitution rules consists of the
26 Caesar ciphers with shifts of 0 through 25.
.25 ‫ إﻟﻰ‬0 ‫ ﺷﻔرة ﻗﯾﺻر ﻣﻊ ﺗﺣوﻻت ﻣن‬26 ‫ﺗﺗﻛون ﻣﺟﻣوﻋﺔ ﻗواﻋد اﻻﺳﺗﺑدال أﺣﺎدﯾﺔ اﻷﺑﺟدﯾﺔ ذات اﻟﺻﻠﺔ ﻣن‬
• Each cipher is denoted by a key letter, which is the ciphertext letter
that substitutes for the plain- text letter a
a ‫ وھو ﺣرف اﻟﻧص اﻟﻣﺷﻔر اﻟذي ﯾﺣل ﻣﺣل ﺣرف اﻟﻧص اﻟﻌﺎدي‬، ‫ﯾﺷﺎر إﻟﻰ ﻛل ﺗﺷﻔﯾر ﺑﺣرف رﺋﯾﺳﻲ‬

CSE 451 - Computer & Network Security


51
Vigenère Cipher
• For example: if the keyword is deceptive, the message “we are
discovered save yourself” is encrypted as
"‫ ﺗﺷﻔﯾر اﻟرﺳﺎﻟﺔ "ﺗم اﻛﺗﺷﺎﻓﻧﺎ أﻧﻘذ ﻧﻔﺳك‬، ‫ إذا ﻛﺎﻧت اﻟﻛﻠﻣﺔ اﻟرﺋﯾﺳﯾﺔ ﺧﺎدﻋﺔ‬:‫ﻋﻠﻰ ﺳﺑﯾل اﻟﻣﺛﺎل‬

CSE 451 - Computer & Network Security


52
Vigenère Cipher

• Encryption Equation is

Historical Substitution Ciphers


• Decryption Equation is
Vigenère Cipher:
Plaintext letters
Key
Ciphertext
CSE 451 - Computer & Network Security
53
Vigenère Cipher - Cryptanalysis
‫ﺗﻛﻣن ﻗوة ھذا اﻟﺗﺷﻔﯾر ﻓﻲ وﺟود اﻟﻌدﯾد ﻣن أﺣرف اﻟﻧص اﻟﻣﺷﻔر ﻟﻛل ﺣرف ﻧص‬
.‫ واﺣد ﻟﻛل ﺣرف ﻓرﯾد ﻣن اﻟﻛﻠﻣﺔ اﻟرﺋﯾﺳﯾﺔ‬، ‫ﻋﺎدي‬
• The strength of this cipher is that there are multiple ciphertext letters
for each plaintext letter, one for each unique letter of the keyword.
• Thus, the letter frequency information is obscured.
.‫ ﯾﺗم ﺣﺟب ﻣﻌﻠوﻣﺎت ﺗردد اﻟﺣرف‬، ‫وﺑﺎﻟﺗﺎﻟﻲ‬
• This scheme is vulnerable to cryptanalysis. Because the key and the
plain- text share the same frequency distribution of letters, a
statistical technique can be applied.
‫ ﻧظرا ﻷن اﻟﻣﻔﺗﺎح واﻟﻧص اﻟﻌﺎدي ﯾﺷﺗرﻛﺎن‬.‫ھذا اﻟﻣﺧطط ﻋرﺿﺔ ﻟﺗﺣﻠﯾل اﻟﺗﺷﻔﯾر‬
.‫ ﯾﻣﻛن ﺗطﺑﯾﻖ ﺗﻘﻧﯾﺔ إﺣﺻﺎﺋﯾﺔ‬، ‫ﻓﻲ ﻧﻔس اﻟﺗوزﯾﻊ اﻟﺗﻛراري ﻟﻠﺣروف‬
• Because not all knowledge of the plaintext structure is lost
‫ﻷﻧﮫ ﻻ ﯾﺗم ﻓﻘد ﻛل اﻟﻣﻌرﻓﺔ ﺑﺑﻧﯾﺔ اﻟﻧص اﻟﻌﺎدي‬

CSE 451 - Computer & Network Security


54
One-Time Pad Vernam ‫ﻣﻘﺗرح ﻛﺗﺣﺳﯾن ﻟﺗﺷﻔﯾر‬
.‫اﻟذي ﯾﻧﺗﺞ ﻋﻧﮫ أﻗﺻﻰ درﺟﺎت اﻷﻣﺎن‬
• Proposed as an improvement to the Vernam cipher that yields the
ultimate in security.
• Using a random key that is as long as the message.
.‫اﺳﺗﺧدام ﻣﻔﺗﺎح ﻋﺷواﺋﻲ ﺑطول اﻟرﺳﺎﻟﺔ‬
• The key need not be repeated, uses to encrypt and decrypt a single
message, and then is discarded.
.‫ ﺛم ﯾﺗم ﺗﺟﺎھﻠﮫ‬، ‫ وﯾﺳﺗﺧدم ﻟﺗﺷﻔﯾر وﻓك ﺗﺷﻔﯾر رﺳﺎﻟﺔ واﺣدة‬، ‫ﻻ ﯾﻠزم ﺗﻛرار اﻟﻣﻔﺗﺎح‬
• Each new message requires a new key of the same length as the new
message. .‫ﺗﺗطﻠب ﻛل رﺳﺎﻟﺔ ﺟدﯾدة ﻣﻔﺗﺎﺣﺎ ﺟدﯾدا ﺑﻧﻔس طول اﻟرﺳﺎﻟﺔ اﻟﺟدﯾدة‬

CSE 451 - Computer & Network Security


55
One-Time Pad Vigenère ‫ إذا ﻛﻧﺎ ﻧﺳﺗﺧدم ﻣﺧطط‬:‫ﻣﺛﺎل‬
‫ اﻟﻧظر ﻓﻲ اﻟﻧص اﻟﻣﺷﻔر‬.‫ وﻟﻛن ﻣﻊ ﻣﻔﺗﺎح ﻟﻣرة واﺣدة ﺑطول اﻟرﺳﺎﻟﺔ‬، ‫ ھو ﺣرف اﻟﻣﺳﺎﻓﺔ‬27 ‫ ﺣرﻓﺎ ﯾﻛون ﻓﯾﮫ اﻟﺣرف‬27 ‫اﻟﻣﻛون ﻣن‬

• Example: If we are using a Vigenère scheme with 27 characters in


which the27 character is the space character, but with a one-time key
that is as long as the message. Consider the ciphertext

CSE 451 - Computer & Network Security


56
One-Time Pad - Cryptanalysis
• The security of the one-time pad is entirely due to the randomness of
the key. .‫ﯾرﺟﻊ أﻣﺎن اﻟﻠوﺣﺔ ﻟﻣرة واﺣدة ﺑﺎﻟﻛﺎﻣل إﻟﻰ ﻋﺷواﺋﯾﺔ اﻟﻣﻔﺗﺎح‬

• If the stream of characters that constitute the key is truly random,


then the stream of characters that constitute the ciphertext will be
truly random. ‫ ﻓﺳﯾﻛون دﻓﻖ اﻷﺣرف‬، ‫إذا ﻛﺎن دﻓﻖ اﻷﺣرف اﻟﺗﻲ ﺗﺷﻛل اﻟﻣﻔﺗﺎح ﻋﺷواﺋﯾﺎ ﺣﻘﺎ‬
.‫اﻟﺗﻲ ﺗﺷﻛل اﻟﻧص اﻟﻣﺷﻔر ﻋﺷواﺋﯾﺎ ﺣﻘﺎ‬
• There are no patterns or regularities that a cryptanalyst can use to
attack the ciphertext ‫ﻻ ﺗوﺟد أﻧﻣﺎط أو اﻧﺗظﺎم ﯾﻣﻛن ﻟﻣﺣﻠل اﻟﺗﺷﻔﯾر اﺳﺗﺧداﻣﮫ ﻟﻣﮭﺎﺟﻣﺔ اﻟﻧص اﻟﻣﺷﻔر‬

CSE 451 - Computer & Network Security


57
One-Time Pad - Cryptanalysis
• The one-time pad offers complete security but, in practice, has two
fundamental difficulties:
:‫ ﺗواﺟﮫ ﺻﻌوﺑﺗﯾن أﺳﺎﺳﯾﺗﯾن‬، ‫ ﻣن اﻟﻧﺎﺣﯾﺔ اﻟﻌﻣﻠﯾﺔ‬، ‫ﺗوﻓر اﻟﻠوﺣﺔ ﻟﻣرة واﺣدة أﻣﺎﻧﺎ ﻛﺎﻣﻼ وﻟﻛن‬
• There is the practical problem of making large quantities of random keys.
Any heavily used system might require millions of random characters on a
regular basis. Supplying truly random characters in this volume is a
significant task.
‫ ﻗد ﯾﺗطﻠب أي ﻧظﺎم ﻣﺳﺗﺧدم ﺑﻛﺛﺎﻓﺔ‬.‫ھﻧﺎك ﻣﺷﻛﻠﺔ ﻋﻣﻠﯾﺔ ﺗﺗﻣﺛل ﻓﻲ ﺻﻧﻊ ﻛﻣﯾﺎت ﻛﺑﯾرة ﻣن اﻟﻣﻔﺎﺗﯾﺢ اﻟﻌﺷواﺋﯾﺔ‬
.‫ ﯾﻌد ﺗوﻓﯾر أﺣرف ﻋﺷواﺋﯾﺔ ﺣﻘﺎ ﻓﻲ ھذا اﻟﻣﺟﻠد ﻣﮭﻣﺔ ﻣﮭﻣﺔ‬.‫ﻣﻼﯾﯾن اﻷﺣرف اﻟﻌﺷواﺋﯾﺔ ﻋﻠﻰ أﺳﺎس ﻣﻧﺗظم‬
• The problem of key distribution and protection. For every message to be
sent, a key of equal length is needed by both sender and receiver.
.‫ ھﻧﺎك ﺣﺎﺟﺔ إﻟﻰ ﻣﻔﺗﺎح ﻣﺗﺳﺎو ﻓﻲ اﻟطول ﻣن ﻗﺑل ﻛل ﻣن اﻟﻣرﺳل واﻟﻣﺗﻠﻘﻲ‬، ‫ ﻟﻛل رﺳﺎﻟﺔ ﯾﺗم إرﺳﺎﻟﮭﺎ‬.‫ﻣﺷﻛﻠﺔ ﺗوزﯾﻊ اﻟﻣﻔﺎﺗﯾﺢ وﺣﻣﺎﯾﺗﮭﺎ‬
• Because of these difficulties, the one-time pad is of limited utility and is
useful primarily for low-bandwidth channels requiring very high security.
‫ ﻓﺈن اﻟﻠوﺣﺔ ﻟﻣرة واﺣدة ذات ﻓﺎﺋدة ﻣﺣدودة وھﻲ ﻣﻔﯾدة ﻓﻲ اﻟﻣﻘﺎم اﻷول ﻟﻠﻘﻧوات ذات‬، ‫ﺑﺳﺑب ھذه اﻟﺻﻌوﺑﺎت‬
.‫اﻟﻧطﺎق اﻟﺗرددي اﻟﻣﻧﺧﻔض اﻟﺗﻲ ﺗﺗطﻠب أﻣﺎﻧﺎ ﻋﺎﻟﯾﺎ ﻟﻠﻐﺎﯾﺔ‬
58
Symmetric Encryption:
2. The Transposition Cipher Techniques
‫ ﺗﻘﻧﯾﺎت ﺗﺷﻔﯾر اﻟﺗﺣوﯾل‬.2 :‫اﻟﺗﺷﻔﯾر اﻟﻣﺗﻣﺎﺛل‬

• A very different kind of mapping is achieved by performing some sort


of permutation on the plaintext letters. This technique is referred to
as a transposition cipher.
‫ﯾﺗم ﺗﺣﻘﯾﻖ ﻧوع ﻣﺧﺗﻠف ﺗﻣﺎﻣﺎ ﻣن اﻟﺗﻌﯾﯾن ﻋن طرﯾﻖ إﺟراء ﻧوع ﻣن اﻟﺗﻘﻠﯾب ﻋﻠﻰ‬
.‫ ﯾﺷﺎر إﻟﻰ ھذه اﻟﺗﻘﻧﯾﺔ ﺑﺎﺳم ﺗﺷﻔﯾر اﻟﺗﺑدﯾل‬.‫أﺣرف اﻟﻧص اﻟﻌﺎدي‬

CSE 451 - Computer & Network Security


59
Rail Fence Technique
‫ﺗﻘﻧﯾﺔ ﺳﯾﺎج اﻟﺳﻛك اﻟﺣدﯾدﯾﺔ‬

• Rail Fence Technique ‫ﺗﻘﻧﯾﺔ ﺳﯾﺎج اﻟﺳﻛك اﻟﺣدﯾدﯾﺔ‬


• The plaintext is written down as a sequence of diagonals and then
read off as a sequence of rows.
.‫ﯾﺗم ﺗدوﯾن اﻟﻧص اﻟﻌﺎدي ﻛﺳﻠﺳﻠﺔ ﻣن اﻷﻗطﺎر ﺛم ﯾﻘرأ ﻛﺳﻠﺳﻠﺔ ﻣن اﻟﺻﻔوف‬
• For example,
• How to encrypt a message “meet me after the toga party” with Rail
Fence? ‫ﻋﻠﻰ ﺳﺑﯾل اﻟﻣﺛﺎل‬
Rail Fence ‫ﻛﯾﻔﯾﺔ ﺗﺷﻔﯾر رﺳﺎﻟﺔ "ﻗﺎﺑﻠﻧﻲ ﺑﻌد ﺣﻔﻠﺔ ﺗوﺟﺎ" ﺑﺎﺳﺗﺧدام‬

To be as ciphertext: MEMATRHTGPRYETEFETEOAAT

CSE 451 - Computer & Network Security


60
Columnar Transposition Cipher
‫ وﻟﻛن ﻣﻊ ﺗﺑدﯾل ﺗرﺗﯾب‬، ‫ ﻋﻣودا ﺗﻠو اﻵﺧر‬، ‫ وﻗراءة اﻟرﺳﺎﻟﺔ‬، ‫ ﺻﻔﺎ ﺗﻠو اﻵﺧر‬، ‫اﻟﻣﺧطط اﻷﻛﺛر ﺗﻌﻘﯾدا ھو ﻛﺗﺎﺑﺔ اﻟرﺳﺎﻟﺔ ﻓﻲ ﻣﺳﺗطﯾل‬
.‫ ﺛم ﯾﺻﺑﺢ ﺗرﺗﯾب اﻷﻋﻣدة ﻣﻔﺗﺎح اﻟﺧوارزﻣﯾﺔ‬.‫اﻷﻋﻣدة‬
• A more complex scheme is to write the message 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.
• Plaintext is written row by row, and then read out column by column in
some scrambled order depends on the key which is the key, to encrypt a
message. Key (4,2,6,1,5,3)
‫ ﺛم ﺗﺗم ﻗراءﺗﮫ ﻋﻣودا ﺗﻠو اﻵﺧر ﻓﻲ ﺑﻌض‬، ‫ﺗﺗم ﻛﺗﺎﺑﺔ اﻟﻧص اﻟﻌﺎدي ﺻﻔﺎ ﺗﻠو اﻵﺧر‬
‫ ﻟﺗﺷﻔﯾر رﺳﺎﻟﺔ‬، ‫ اﻟﺗرﺗﯾب اﻟﻣﺧﻠوط ﯾﻌﺗﻣد ﻋﻠﻰ اﻟﻣﻔﺗﺎح اﻟذي ھو اﻟﻣﻔﺗﺎح‬4 2 6 1 5 3
• Plaintext: M E E T M E
• meet me after the toga party A F T E R T
• Ciphertext: H E T O G A

• TEOTEFEAETAXMAHPMRGYETTR P A R T Y X
CSE 451 - Computer & Network Security
61
Columnar Transposition Cipher
• To decrypt
• Ciphertext: TEOTEFEAETAXMAHPMRGYETTR Key: 4,2,6,1,5,3
TEOT EFEA ETAX MAHP MRGY ETTR

Number of letters: 24 4 2 6 1 5 3
Key:6 M
24/6= 4 A
H
P

Start with group number 4 based on the key order to fill the table column by
column, following the sequence of the given key. Then we read it row by row
to get the plaintext: meet me after the toga party
‫ ﺑﺎﺗﺑﺎع ﺗﺳﻠﺳل اﻟﻣﻔﺗﺎح‬، ‫ ﺑﻧﺎء ﻋﻠﻰ ﺗرﺗﯾب اﻟﻣﻔﺎﺗﯾﺢ ﻟﻣلء ﻋﻣود اﻟﺟدول ﺑﻌﻣود‬4 ‫اﺑدأ ﺑﺎﻟﻣﺟﻣوﻋﺔ رﻗم‬
‫ ﻗﺎﺑﻠﻧﻲ ﺑﻌد ﺣﻔﻠﺔ ﺗوﺟﺎ‬:‫ ﺛم ﻧﻘرأه ﺻﻔﺎ ﺗﻠو اﻵﺧر ﻟﻠﺣﺻول ﻋﻠﻰ اﻟﻧص اﻟﻌﺎدي‬.‫اﻟﻣﺣدد‬ 62
Route Cipher
:‫ﺗﺷﻔﯾر اﻟطرﯾﻖ‬
X ‫ﯾﺗم ﻛﺗﺎﺑﺔ اﻟﻧص اﻟﻌﺎدي أوﻻ ﺻﻔﺎ ﺗﻠو اﻵﺧر وﻧﺳﺗﺧدم اﻟﻘﯾم اﻟﺧﺎﻟﯾﺔ ﻓﻲ اﻟﻧﮭﺎﯾﺔ‬
• Route Cipher: ‫ ﻧﻘرأ ﺑﻧﺎء ﻋﻠﻰ اﻟﻣﺳﺎر ﻣن اﻟزاوﯾﺔ اﻟﺧﺎرﺟﯾﺔ إﻟﻰ‬، ‫ ﺛم ﻟﻠﺗﺷﻔﯾر‬.‫ﻹﻛﻣﺎل اﻟﻣﺳﺗطﯾل‬
.‫اﻟداﺧل اﻟﻣﺗدﻓﻖ ﻗﺎﻋدة اﻟدوران‬
• Plaintext is first written row by row and we use nulls at the end X to
complete the rectangle. Then to encrypt, we read based on the route
from the outer corner to inside flowing the rule of rotation.
• Plaintext: M E E T M E

• meet me after the toga party A F T E R T

H E T O G A

• Ciphertext: P A R T Y X

• ETAXYTRAPHAMEETMRGOTEFTE
CSE 451 - Computer & Network Security
63
Summery
• To be continued next week with more encryption methods to
understand!!
!! ‫ﻟﺗﺳﺗﻣر اﻷﺳﺑوع اﻟﻣﻘﺑل ﻣﻊ اﻟﻣزﯾد ﻣن طرق اﻟﺗﺷﻔﯾر ﻟﻔﮭﻣﮭﺎ‬

• Activities: Practice on these encryption techniques with different


examples  ‫ ﺗدرب ﻋﻠﻰ ﺗﻘﻧﯾﺎت اﻟﺗﺷﻔﯾر ھذه ﻣﻊ أﻣﺛﻠﺔ ﻣﺧﺗﻠﻔﺔ‬:‫اﻷﻧﺷطﺔ‬

CSE 451 - Computer & Network Security


64

You might also like