Professional Documents
Culture Documents
4 Fiq
4 Fiq
Iاﻟﺗﺷﻔﯾر
Chapter 4
Example:
Hacker
1.1
• 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?
ﻛﯾﻔﯾﺔ ﺗﺄﻣﯾن اﻻﺗﺻﺎل؟
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.
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.
ﻓﯾﻣﻛﻧﮫ ﺑﺳﮭوﻟﺔ ﻓك ﺗﺷﻔﯾر اﻟرﺳﺎﻟﺔ ﻷن، ﺛم إذا ﺣﺻل أﺣد اﻟﻣﺗﺳﻠﻠﯾن ﻋﻠﻰ اﻟﻣﻔﺗﺎح
.اﻟﺧوارزﻣﯾﺔ ﻣﻌروﻓﺔ ﻟﻠﺟﻣﮭور
• 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,
C = E(3,p) = (p + 3)mod26
p = D(k,C) = (C - k)mod26
• 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 ﯾﻣﻛن ﺗﺣدﯾد اﻟﺗردد اﻟﻧﺳﺑﻲ ﻟﻠﺣروف وﻣﻘﺎرﻧﺗﮫ ﺑﺗوزﯾﻊ اﻟﺗردد اﻟﻘﯾﺎﺳﻲ ﻟﻠﻐﺔ اﻹﻧﺟﻠﯾزﯾﺔ ﻟﻛﺳر اﻟﺷﻔرات
، ﯾﺗم ﻓﺻل أﺣرف اﻟﻧص اﻟﻌﺎدي اﻟﻣﺗﻛررة اﻟﻣوﺟودة ﻓﻲ ﻧﻔس اﻟزوج ﺑﺣرف ﺣﺷو
x ، ﻣﺛل
ba lx lo on. ﺑﺣﯾث ﯾﺗم اﻟﺗﻌﺎﻣل ﻣﻊ ھذا اﻟﺑﺎﻟون ﻋﻠﻰ أﻧﮫ
• 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 ﯾﺗم ﺗﺷﻔﯾر
ﯾﺗم اﺳﺗﺑدال ﺣرﻓﯾن ﻋﺎدﯾﯾن ﯾﻘﻌﺎن ﻓﻲ ﻧﻔس اﻟﺻف ﻣن اﻟﻣﺻﻔوﻓﺔ ﺑﺎﻟﺣرف:اﻟﻘﺎﻋدة
ﻣﻊ وﺟود اﻟﻌﻧﺻر اﻷول ﻣن اﻟﺻف ﺑﺷﻛل داﺋري ﺑﻌد، اﻟﻣوﺟود ﻋﻠﻰ اﻟﯾﻣﯾن
.اﻷﺧﯾر
• 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.
• 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).
• Encryption Equation is
To be as ciphertext: MEMATRHTGPRYETEFETEOAAT
• 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
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!!
!! ﻟﺗﺳﺗﻣر اﻷﺳﺑوع اﻟﻣﻘﺑل ﻣﻊ اﻟﻣزﯾد ﻣن طرق اﻟﺗﺷﻔﯾر ﻟﻔﮭﻣﮭﺎ