Top Banner
1 Web security
34

1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

Dec 29, 2015

Download

Documents

Belinda Fields
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

1

Web security

Page 2: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

2

Applications

– Email– electronic commerce– electronic voting– homework submission– E-bank– Paper submission

Page 3: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

3

Security Requirments

Authentication: identifying someone (or something) reliably. Proving you are who you say you are.

Authorization: permission to access a resource.

Integrity: data has not changed by someone else.

Confidentiality: data is only received by the target

Page 4: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

4

Terminology

Encryption: Scramble data so that only someone with a secret can make sense of the data.

Decryption: Descrambling encrypted data. DES: Data Encryption Standard: secret key

cryptographic function standardized by NBS (NIST).

AES: Advanced Encryption Standard: recent standard for symmetric cryptography

Page 5: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

5

Terminology (cont.)

Secret Key Cryptography: a cryptographic scheme where the same key is used to encrypt and decrypt data. Also called symmetric encryption.

Public Key Cryptography: a cryptographic scheme where different keys are used for encryption and decryption (asymmetric).

Page 6: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

6

Terminology (more!) Firewall: a network component that

separates two networks and (typically) operates in the upper layers of the OSI reference model (Application layer).

Screening Router: a discriminating router that filters packets based on network layer (and sometimes transport layer) protocols and addresses.

Page 7: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

7

Attack types

DoS (denial of service): attempting to disrupt or deny a useful service.

Eavesdropping: interception of a third-party (malicious) host

Modification: changing data Fabrication: producing data on behalf of

another person.

Page 8: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

8

Historical Ciphers

Caesar cipher

Page 9: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

9

Data Encryption Standard (DES)

Designed at IBM in 1975– Changes suggested by the NSA

Standardized by NIST in 1977– Official cipher for civilian cryptography– Reviewed by the NSA – Used by CIA

Combines substitutions and permutations– Operates on bits

Page 10: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

10

Feistel Network

Iterative structure Efficient hardware

implementation Non-linear element F

provides security Multiple rounds

provide mixing (diffusion) between the two halves

Page 11: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

11

The AES Cipher - Rijndael designed by Rijmen-Daemen in Belgium

has 128/192/256 bit keys, 128 bit data

an iterative cipher– treats data in 4 groups of 4 bytes

– expands 128-bit key to 4 groups of 4 bytes(larger keys are expanded to more groups)

– operates an entire block in every round

– round number dependent on key size

designed to be:– resistant against known attacks

– speed and code compactness on many CPUs

– design simplicity

Page 12: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

12

RSA by Rivest, Shamir & Adleman of MIT in 1977

best known & widely used public-key scheme

based on exponentiation in a finite field over integers modulo a prime – exponentiation takes O((log n)3) operations (easy)

uses large integers (eg. 1024 bits)

security due to cost of factoring large numbers

Page 13: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

13

RSA Key SetupGeneration of a public/private key pair:

• select two large primes at random: p, q

• compute the system modulus n = p·q

• select at random the encryption key e (n)=(p-1)(q-1)

– where 1<e<(n), gcd(e,(n))=1

• solve following equation to find decryption key d :e·d=1 mod (n) and 0≤d≤n

• public encryption key: KU={e,n}

• private decryption key: KR={d,n}

Page 14: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

14

RSA Example1. Select primes: p=17 & q=11

2. Compute n = pq =17×11=187

3. Compute (n)=(p–1)(q-1)=16×10=160

4. Select e : gcd(e,160)=1; choose e=7

5. Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23×7=161= 10×160+1

6. Public key KU={7,187}

7. Private key KR={23,187}

Page 15: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

15

RSA Use to encrypt a message M the sender:

– obtains public key of recipient KU={e,n}

– computes: C=Me mod n, where 0≤M<n

to decrypt the ciphertext C the owner:– uses the private key KR={d,n}

– computes: M=Cd mod n

note that the message M must be smaller than the modulus n

Page 16: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

16

RSA Example cont’d sample RSA encryption/decryption is:

given message M = 88 (88<187)

encryption:

C = 887 mod 187 = 11

decryption:

M = 1123 mod 187 = 88

Page 17: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

17

Public Key Cryptography(a.k.a. asymmetric cryptography)

• Each entity has 2 keys:– private key (a secret)– public key (well known).

Page 18: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

18

• Private keys are used for decrypting.• Public keys are used for encrypting.

encryptionplaintext ciphertext

public key

decryptionciphertext plaintext

private key

Using Keys

Page 19: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

19

Digital Signature• Public key cryptography is also used to

provide digital signatures.

signingplaintext signed message

private key

verificationsigned message plaintext

public key

Page 20: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

20

Transmitting over an insecure channel.

Alice wants to send Bob a private message.

Apublic is Alice’s public key.

Aprivate is Alice’s private key.

Bpublic is Bob’s public key.

Bprivate is Bob’s private key.

Page 21: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

21

Hello Bob,Wanna get together?

AliceAlice BobBob

encrypt using Bpublic decrypt using Bprivate

Page 22: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

22

OK Alice,Your place or mine?

AliceAlice BobBob

decrypt using Aprivate encrypt using Apublic

Page 23: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

23

Bob’s Dilemma

• Nobody can read the message from Alice, but anyone could produce it.

• How does Bob know that the message was really sent from Alice?

• Bob may be comforted to know that only Alice can read his reply.

Page 24: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

24

Alice can sign her message!

• Alice can create a digital signature and prove she sent the message (or someone with knowledge of her private key).

• The signature can be a message digest encrypted with Aprivate.

Page 25: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

25

AliceAlice BobBob

Sign with Aprivate check signature using Apublic

encrypt using Bpublic decrypt using Bprivate

Revised Scheme

Page 26: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

26

Another possible problem• Suppose Bill receives a message from Alice

including a digital signature.

“meet me at the library tonight”

• Bill sends the same message to Joe so that it looks like the message came from Alice.

• Bill includes the digital signature from the message Alice sent to him.

• Joe is convinced Alice sent the message!

Page 27: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

27

Solution?

• Always start your messages with:– Dear Bill,

• Create a digest from the encrypted message and sign that digest.

• There are many other schemes as well.

Page 28: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

28

Authentication

Page 29: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

29

Authentication

Page 30: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

30

Secure Protocols

• Many application protocols include the use of cryptography as part of the application level protocol.– The cryptographic scheme employed is

part of the protocol.– If stronger cryptographic tools become

available we need to change the protocol.

Page 31: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

31

SSL and TLS

• Secure Sockets Layer (SSL) is a different approach - a new layer is added that provides a secure channel over a TCP only link.

• TLS is Transport Layer Security (IETF standard based on SSL).

Page 32: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

32

SSL layer

Application

SSL

TCP

IP

Application

SSL

TCP

IP

Page 33: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

33

Advantages of SSL/TLS

• Independent of application layer

• Includes support for negotiated encryption techniques.– easy to add new techniques.

• Possible to switch encryption algorithms in the middle of a session.

Page 34: 1 Web security. 2 Applications –Email –electronic commerce –electronic voting –homework submission –E-bank –Paper submission.

34

HTTPS Usage

• HTTPS is HTTP running over SSL.– used for most secure web transactions.– HTTPS server usually runs on port 443.– Include notion of verification of server via a

certificate.– Central trusted source of certificates.