presentation title your company information. cryptography2 syllabus course syllabus...

37
Presentation Title Your company information

Upload: octavia-watkins

Post on 16-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Presentation TitleYour company information

Page 2: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Cryptography 2

Course Syllabus• 

بها – المتعلقة والقوانين االنترنت استخدام أخالقياتالمعلومات – أمن في مقدمة

ومصطلحات • مفاهيمالمتناظرة • وغير المتناظرة Cryptographyالتعميةالرقمي • Digital Signatureالتوقيعالرقمية • Digital Certificateالشهادات

– : االنترنت بروتوكوالت في األمنية HTTP, SMTPالمشاكلFTP

الحماية – واستخداماتها SSL, TLS, HTTPS, PGPبرتوكوالتالوب تطبيقات في

–: الوب على الهجوم أنواع•Cross-Site Request Forgery (CSRF)

Page 3: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Cryptography 3

Syrian Virtual UniversityMWS/MWT

Internet &Web Security

S2

• Dr. Moutasem Shafa’amry• [email protected]

Page 4: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Cryptography 4

Course Syllabus• 

بها – المتعلقة والقوانين االنترنت استخدام أخالقياتالمعلومات – أمن في مقدمة

ومصطلحات • مفاهيمالمتناظرة • وغير المتناظرة Cryptographyالتعميةالرقمي • Digital Signatureالتوقيعالرقمية • Digital Certificateالشهادات

– : االنترنت بروتوكوالت في األمنية HTTP, SMTPالمشاكلFTP

الحماية – واستخداماتها SSL, TLS, HTTPS, PGPبرتوكوالتالوب تطبيقات في

–: الوب على الهجوم أنواع•Cross-Site Request Forgery (CSRF)

Page 5: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Cryptography 5

Cryptography• Secrecy• Ciphers• Stream & Bloc

ciphers• Secret Key

Cryptography• Key Exchange• Public Key Cryptography

• Digital Signatures• Applications Security

What does it say?

Page 6: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Why Cryptography?

• Network information needs to be communicated through insecure channel.

• Stored information may be accessed without proper authorization.

• Cryptography is a systematic way to make that harder.

Cryptography 6

Page 7: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Common Security Requirements

• Confidentiality :Secrecy(encryption)• Integrity (signature/encryption)• AVAILABILITY• CIA (Conf., Integrity, Availability)

– Authenticity(signature/encryption)– Non-repudiation (signature)

Cryptography 7

Page 8: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

What Cryptography can do?

• Encryption: only the authorized party can understand the encrypted message.

• Signature: allow people to verify the authenticity of the message.

Cryptography 8

Page 9: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Classical Cryptography

• Shift Cipher – (a special case used by Caesar)

• Substitution Cipher– Affine Cipher– Vigenere Cipher– Hill Cipher

• Permutation Cipher

Cryptography 9

Page 10: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Crypto-analysis

• Ciphertext-only attack• Known plaintext attack• Chosen plaintext attack• Adaptive Chosen plaintext attack

Cryptography 10

Page 11: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Crypto-analysis

• Shift Cipher: English histogram• Substitution Cipher: histogram again• Affine Cipher: histogram• Vigenere Cipher: more complicated stat• Hill Cipher: Known plaintext attack• Permutation Cipher: histogram +

semantics

Cryptography 11

Page 12: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

12

Confidentiality (Secrecy)• Scenario: Alice wants to send a message (plaintext p) to

Bob. The communication channel is insecure and can be eavesdropped by Trudy. If Alice and Bob have previously agreed on an encryption scheme (cipher), the message can be sent encrypted (ciphertext c)

Alice Bob

cencrypt decryptp c p

TrudyIssues:

What is a good cipher?What is the complexity of encrypting/decrypting?What is the size of the ciphertext, relative to the plaintext?If Alice and Bob have never interacted before, how can they agree on a cipher?

Page 13: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

13

Traditional Cryptography

• Ciphers were already studied in ancient times• Caesar’s cipher: replace a with d replace b with e ... replace z with c• A more general monoalphabetic substitution cipher maps

each letter to some other letter.

Page 14: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

14

Breaking Traditional Cryptography

• Armed with simple statistcal knowledge, Trudy can easily break a mono-alphabetic substitution cipher– most frequent letters in English: e, t, o, a, n, i, ... – most frequent digrams: th, in, er, re, an, ... – most frequent trigrams: the, ing, and, ion, ...

• The first description of the frequency analysis attack appears in a book written in the 9th century by the Arab philosopher al-Kindi

Page 15: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Cryptography 15

Example (S. Singh, The Code Book, 1999)

• Ciphertext• PCQ VMJYPD LBYK LYSO KBXBJXWXV BXV ZCJPO EYPD

KBXBJYUXJ LBJOO KCPK. CP LBO LBCMKXPV XPV IYJKL PYDBL, QBOP KBO BXV OPVOV LBO LXRO CI SX'XJMI, KBO JCKO XPV EYKKOV LBO DJCMPV ZOICJO BYS, KXUYPD: 'DJOXL EYPD, ICJ X LBCMKXPV XPV CPO PYDBLK Y BXNO ZOOP JOACMPLYPD LC UCM LBO IXZROK CI FXKL XDOK XPV LBO RODOPVK CI XPAYOPL EYPDK. SXU Y SXEO KC ZCRV XK LC AJXNO X IXNCMJ CI UCMJ SXGOKLU?'

OFYRCDMO, LXROK IJCS LBO LBCMKXPV XPV CPO PYDBLK

Any Guesses???

Page 16: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

16

Frequency Analysis

• Identyfying comon letters, digrams and trigrams...• PCQ VMJYPD LBYK LYSO KBXBJXWXV BXV ZCJPO EYPD KBXBJYUXJ

LBJOO KCPK. CP LBO LBCMKXPV XPV IYJKL PYDBL, QBOP KBO BXV OPVOV LBO LXRO CI SX'XJMI, KBO JCKO XPV EYKKOV LBO DJCMPV ZOICJO BYS, KXUYPD: 'DJOXL EYPD, X LBCMKXPV XPV CPO PYDBLK Y BXNO ZOOP JOACMPLYPD LC UCM LBO IXZROK CI FXKL XDOK XPV LBO RODOPVK CI XPAYOPL EYPDK. SXU Y SXEO KC ZCRV XK LC AJXNO X IXNCMJ CI UCMJ SXGOKLU?'

OFYRCDMO, LXROK IJCS LBO LBCMKXPV XPV CPO PYDBLK• First guess: LBO is THE

Page 17: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

17

Frequency Analysis

• Assuming LBO represents THE we replace L with T, B with H, and O with E and get

• PCQ VMJYPD THYK TYSE KHXHJXWXV HXV ZCJPE EYPD KHXHJYUXJ THJEE KCPK. CP THE THCMKXPV XPV IYJKT PYDHT, QHEP KHO HXV EPVEV THE LXRE CI SX'XJMI, KHE JCKE XPV EYKKOV THE DJCMPV ZEICJE HYS, KXUYPD: 'DJEXT EYPD, ICJ X LHCMKXPV XPV CPE PYDHLK Y HXNE ZEEP JEACMPTYPD TC UCM THE

IXZREK CI FXKL XDEK XPV THE REDEPVK CI XPAYEPT EYPDK. SXU Y SXEE KC ZCRV XK TC AJXNE X IXNCMJ CI UCMJ SXGEKTU?'

EFYRCDME, TXREK IJCS THE LHCMKXPV XPV CPE PYDBTK• More guesses…?

Page 18: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

18

• Code

• Plaintext

Now during this time Shahrazad had borne King Shahriyar three sons. On the thousand and first night, when she had ended the tale of Ma'aruf, she rose and kissed the ground before him, saying: 'Great King, for a thousand and one nights I have been recounting to you the fables of past ages and the legends of ancient kings. May I make so bold as to crave a favour of your majesty?’

Epilogue, Tales from the Thousand and One Nights

X Z A V O I D B Y G E R S P C F H J K L M N Q T U WA 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

Page 19: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Frequency of Letter Occurrence

Cryptography 19

Page 20: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

20

Secret-Key Ciphers

• A secret-key cipher uses a key to encrypt and decrypt• Caesar’s generalized cypher uses modular addition of each

character (viewed as an integer) with the key:

ci = pi + k mod m

pi = ci-k mod m• A more secure scheme is to use modular exponentiation to

encrypt blocks of characters (viewed as integers):

c [i,j] = p [i,j]k mod m

where m is a large prime.

Page 21: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

21

Secret-Key Ciphersmade more secure

• Unlike modular addition, modular exponentiation is considered computationally infeasible (exponential) to invert. Thus, even if Trudy guesses a pair: (c [i,j] ,p [i,j]), (for example, she knows the plaintext starts with the words “Dear Bob”) she still cannot compute the key k.

• Alice and Bob need to share only key k. Bob decrypts using Euler’s Theorem from number theory:

p[i,j] = c [i,j] d mod mwhere d can be easily computed from k and m using Euclid’s gcd algorithm.

Page 22: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Block Cipher• Divide input bit stream into n-bit sections, encrypt

only that section, no dependency/history between sections

Cryptography 22

• In a good block cipher, each output bit is a function of all n input bits and all k key bits

Page 23: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Encryption Mode (ECB)

Cryptography 23

• Electronic Code Book (ECB) mode for block ciphers of a long digital sequence

• Vulnerable to replay attacks: if an attacker thinks block C2 corresponds to $ amount, then substitute another Ck

• Attacker can also build a codebook of <Ck, guessed Pk> pairs

Page 24: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Encryption Mode (CBC)

Cryptography 24

• Cipher Block Chaining (CBC) mode for block ciphers

• Inhibits replay attacks and codebook building: identical input plaintext Pi =Pk won’t result in same output code due to memory-based chaining

• IV = Initialization Vector – use only once

Page 25: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

25

How to Establish a Shared Key?

• What if Alice and Bob have never met and did not agree on a key?

• The Diffie-Hellman key exchange protocol (1976) allows strangers to establish a secret shared key while communicating over an insecure channel

Page 26: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

26

The Diffie-Hellman key exchange

• Alice picks her secret “ half-key” x (a large integer) and two large primes m and g. She sends to Bob:

(n, g, gx mod m)• Even if Trudy intercepts (n, g, gx mod m), she cannot figure out x

because modular logarithms are hard to compute.• Bob picks his secret half-key y and sends to Alice:

(gy mod m)• Again, Trudy cannot figure out y.• The shared key is: gxy mod m

– Bob computes it as (gx mod m)y mod m– Alice computes it as (gy mod m)x mod m

Page 27: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

27

Algorithmic Issues(How to do it Fast)

• How can we efficiently compute modular exponents for large integers?

• NOTE: It is not efficient to compute q = gx mod m in the obvious way:p = gx q = a mod m

Page 28: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

28

Repeated Squaring Algorithm

• represent x in binary: xb-1xb-2 ... x1`x0

• repeat b-1 timesg = g2 mod m

• This yieldsp0 = g mod m

p1 = g2 mod m

p2 = g4 mod m…

pb-1= g2b-1 mod m for i = 0 to b-1• q = qxipi mod m• The number of arithmetic operations performed is

proportional to log x

Page 29: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

Cryptography 29

The Woman-in-the-Middle Attack

• Trudy can fool Alice and Bob to share a secret key with her

• How?

Page 30: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

30

Public Key Ciphers: how to• A pair of keys is used (e,d)• Key e is made public and is used to encrypt• Key d is kept private and is used to decrypt• RSA, by Rivest, Shamir, Adleman (1978) is the most popular pubkic

key cipher– select a pair of large primes, p and q– let e = pq be the public key– define (e ) = (p-1)(q-1) – let d be the private key, where 3dmod (e) = 1– d is the inverse of 3 mod (e ) – encrypt x with c = x3mod e– decrypt c with x = cdmod e– we have x = x3d mod e

Page 31: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

31

Public Key Ciphers: Conclusions

• RSA is considered secure because the only known way to find d from e is to factor e into p and q, a problem believed to be computationally hard

• NOTE: The RSA patent expired in September 2000

Page 32: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

32

Digital Signatures

• Alice sends a message to Bob encrypting it with Bob’s public key.

• Bob decrypts the message using his private key.• How can Bob determine that the message received was

indeed sent by Alice? After all, Trudy also knows Bob’s public key.

Page 33: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

33

Digital Signatures

• Alice can provide a digital signature for the message: s = xd mod e• If Bob receives both x and s, he computes:

– y = s3 mod e = xd3 mod e = x• Thus, if y = x, Bob knows that Alice indeed sent x, since she is the

only person who can compute s from x.• Also, Alice cannot cheat and deny to have sent message x

(nonrepudiation).• Using digital signatures, Alice and Bob can authenticate each other

and prevent Trudy’s woman-in-the-middle attacks• Validating a signed message requires knowledge of the other

party’s public key.

Page 34: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

34

Internet Security

• Recall that validating a signature requires knowledge of the other party’s public key

• How do we know other people’s public keys?• Certification Authorities (e.g., Verisign) provide certificates that

bind identities to public keys• A certificate is a pair (id, key) signed by the CA• A user needs to know only the public key of the CA

Page 35: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة

35

Internet Security

• Some secret-key ciphers (triple DES, IDEA, BLOWFISH) are much faster than RSA

• To communicate securely, a two-phase protocol is adopted:– a shared secret key k is established using RSA– data is transfered between the parties using a secret-key cipher and the

shared key k

• Examples:– SSH (secure shell) for secure host login– SSL (secure socket layer) for secure Web access (https), which uses an

additional certification phase

Page 36: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة
Page 37: Presentation Title Your company information. Cryptography2 Syllabus Course Syllabus –أخلاقيات استخدام الانترنت والقوانين المتعلقة بها –مقدمة