Network Security Sevices: Confidentiality

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 39

network security Sevices

Confidentiality: only sender, intended receiver


should “understand” message contents
 sender encrypts message
 receiver decrypts message

Authentication: sender, receiver want to confirm


identity of each other
Message integrity: sender, receiver want to ensure
message not altered (in transit, or afterwards)
without detection
Access and availability: services must be accessible
and available to users

1
Friends and enemies: Alice, Bob, Trudy
 well-known in network security world
 Bob, Alice want to communicate “securely”
 Trudy (intruder) may intercept, delete, add messages

Alice Bob
data, control
channel
messages

data secure secure data


sender receiver

Trudy
2
Who might Bob, Alice be?
 web browser/server for electronic
transactions (e.g., on-line purchases)
 on-line banking client/server
 DNS servers

3
There are bad guys (and girls) out there!
Q: what can a “bad guy” do?
A: a lot!
 Eavesdrop(spy): intercept messages
 actively insert messages into connection
 Impersonation(imitation): can fake (spoof)
source address in packet (or any field in
packet)
 hijacking: “take over” ongoing connection by
removing sender or receiver, inserting himself
in place
 denial of service: prevent service from being
used by others (e.g., by overloading resources)

4
Cryptography
cryptography: a set of mathematical
functions with a set of nice properties. A
common mechanism for enforcing policies.
encrypt clear text into cipher text, and
vice versa.
properties of good encryption techniques
 encryption scheme depends not on secrecy of
algorithm but on parameter of algorithm (i.e.,
encryption key)
 extremely difficult for an intruder to
determine the encryption key
5
Cryptography algorithms

symmetric key algorithm: one shared by a


pair of users used for both encryption and
decryption

asymmetric or public/private key


algorithms are based on each user having
two keys:
 public key – in public
 private key – key known only to individual
user
6
The language of cryptography
Alice’s Bob’s
K encryption K decryption
A
key B key

plaintext encryption ciphertext decryption plaintext


algorithm algorithm

symmetric key crypto: sender, receiver keys identical


public-key crypto: encryption key public, decryption key
secret (private)

7
Symmetric key cryptography
substitution cipher: substituting one thing for another
 monoalphabetic cipher: substitute one letter for another

plaintext: abcdefghijklmnopqrstuvwxyz

ciphertext: mnbvcxzasdfghjklpoiuytrewq

E.g.: Plaintext: bob. i love you. alice


ciphertext: nkn. s gktc wky. mgsbc

8
Symmetric key cryptography

KA-B KA-B

plaintext encryption ciphertext decryption plaintext


message, m algorithm algorithm
K (m)
A-B
m=K
A-B
( KA-B(m) )

symmetric key crypto: Bob and Alice share know same


(symmetric) key: K
A-B
 e.g., key is knowing substitution pattern in mono
alphabetic substitution cipher

9
Symmetric key crypto: DES
DES: Data Encryption Standard
 US encryption standard [NIST 1993]
 56-bit symmetric key, 64-bit plaintext input
 How secure is DES?
DES challenge: 56-bit-key-encrypted phrase
(“Strong cryptography makes the world a safer
place”) decrypted (brute force) in 4 months
 no known “backdoor” decryption approach
 making DES more secure:
 use three keys sequentially (3-DES) on each datum
 use cipher-block chaining

10
Symmetric key
crypto: DES
DES operation
initial permutation
16 identical “rounds” of
function application,
each using different
48 bits of key
final permutation

11
AES: Advanced Encryption Standard

 new (Nov. 2001) symmetric-key NIST


standard, replacing DES
 processes data in 128 bit blocks
 128, 192, or 256 bit keys
 brute force decryption (try each key)
taking 1 sec on DES, takes 149 trillion
years for AES

12
Public key cryptography

symmetric key crypto public key cryptography


 requires sender,  radically different
receiver know shared approach [Diffie-
secret key Hellman76, RSA78]
 Q: how to agree on key  sender, receiver do
in first place not share secret key
(particularly if never  public encryption key
“met”)? known to all
 private decryption
key known only to
receiver

13
Public key cryptography
+ Bob’s public
K
B key

- Bob’s private
K
B key

plaintext encryption ciphertext decryption plaintext


message, m algorithm + algorithm message
K (m) - +
B m = K B(K (m))
B

14
Public key encryption algorithms

Requirements:
+ . .
1 need K B( ) and K - ( ) such that
B
- +
K (K (m)) = m
B B
+
2 given public key KB , it should be
impossible to compute private
-
key K B

RSA: Rivest, Shamir, Adleman algorithm


15
RSA(RSA: Rivest, Shamir, Adleman
algorithm): choosing keys
1. choose two large prime numbers p, q.
(e.g., 1024 bits each)

2. compute n = pq, z = (p-1)(q-1)

3. choose e (with e<n) that has no common factors


with z. (e, z are “relatively prime”).

4. choose d such that ed-1 is exactly divisible by z.


(in other words: ed mod z = 1 ).

5. public key is (n,e). private key is (n,d).


+ -
KB KB
16
RSA: encryption, decryption
0. Given (n,e) and (n,d) as computed above

1. To encrypt bit pattern, m, compute


e
c = m e mod n (i.e., remainder when m is divided by n)

2. To decrypt received bit pattern, c, compute


d
m = c d mod n (i.e., remainder when c is divided by n)

17
RSA example:
Bob chooses p=5, q=7. Then n=35, z=24.
e=5 (so e, z relatively prime).
d=29 (so ed-1 exactly divisible by z.

18
Digital signatures

Cryptographic technique analogous to hand-


written signatures.
 sender (Bob) digitally signs document,
establishing he is document owner/creator.
 verifiable, nonforgeable: recipient (Alice) can
prove to someone that Bob, and no one else
(including Alice), must have signed document

19
Message digests large
H: Hash
message
Computationally expensive m
Function
to public-key-encrypt
long messages
H(m)
Goal: fixed-length, easy-
to-compute digital
Hash function properties:
“fingerprint”
 many-to-1
 apply hash function(A
 produces fixed-size msg
hash function is any
algorithm that maps digest (fingerprint)
data of variable length  given message digest x,
to data of a fixed computationally
length) H to m, get infeasible to find m such
fixed size message that x = H(m)
digest, H(m). 20
Digital Signature = Signed Message
Digest

Bob sends digitally signed Alice verifies signature and


message: integrity of digitally signed
message:
large
message H: Hash encrypted
m function H(m)
msg digest
-
KB(H(m))
Bob’s digital large
private signature message
- Bob’s
key KB (encrypt) m digital
public signature
key +
encrypted H: Hash KB (decrypt)
msg digest function
-
+ KB(H(m))
H(m) H(m)

equal
?
21
Example Systems
1.Pretty good privacy (PGP)
 Pretty Good Privacy (PGP)
 Pretty Good Privacy (PGP) is a widely used approach to
providing security for electronic mail.
 It provides authentication, confidentiality, data integrity,
and non repudiation.
 Originally devised by Phil Zimmerman
 PGP’s confidentiality and receiver authentication depend on
the receiver of an email message having a public key that is
known to the sender.
 To provide sender authentication and non repudiation, the
sender must have a public key that is known by the receiver.
 PGP supports RSA.
A PGP signed message:

---BEGIN PGP SIGNED MESSAGE---


Hash: SHA1

Bob:My husband is out of town


tonight.Passionately yours,
Alice

---BEGIN PGP SIGNATURE---


Version: PGP 5.0
Charset: noconv
yhHJRHhGJGhgg/12EpJ+lo8gE4vB3mqJh
FEvZP9t6n7G6m5Gw2
---END PGP SIGNATURE---

23
 Example: PGP (Pretty Good Privacy)

6. verify the
1. signed with the 5. decrypted with signature using
sender’s private key the session key the sender’s
public key
2. encrypted with the
session key

3. encrypted with the


4. decrypted with the
recipient’s public key
recipient’s private key

24
 Pretty Good Privacy (PGP)

PGP’s steps to prepare a message for


emailing from Alice to Bob
 PGP Algorithms
 Symmetric encryption:
• DES, 3DES, AES and others.
 Public key encryption of session keys:
• RSA or ElGamal.
 Hashing:
• SHA-1, MD-5 and others.
 Signature:
• RSA, DSS, ECDSA and others.
PGP use:
• public keys for encrypting session
keys / verifying signatures.
• private keys for decrypting session
keys / creating signatures.
Example Systems
2. Secure Shell (SSH)
• SSH is a protocol for secure remote
access to a machine over untrusted
networks.
• SSH is a replacement for telnet, rsh, rlogin
and can replace ftp.
• Uses Encryption.
• SSH is not a shell like Unix Bourne shell
and C shell (wildcard expansion and
command interpreter)
Features

 Transmission is secure.
 Transmission can be compressed.
History of SSH?

 Created by Tatu Ylönen in July 1995, a


student of Helsinki University of
Technology
 Free SSH1 version
 Founded SSH Communications Security,
Ltd
 SSH 2 version
 Open SSH
Functions

 Secure Command Shell


 Port Forwarding
 Secure file transfer.
Secure Command Shell

 Allow you to edit files.


 View the contents of directories.
 Custom based applications.
 Create user accounts.
 Change permissions.
 Anything can be done from command prompt can
be done remotely and securely.
Port Forwarding

 Powerful Tool.
 provide security to TCP/IP applications
including e-mail, sales and customer
contact databases, and in-house
applications.
 allows data from normally unsecured
TCP/IP applications to be secured.
Port Forwarding
 SSH version 2 consist of the following
protocols
1.Transport layer protocol SSH-TRANS
2.Authentication protocol SSH-AUTH
3.Connection protocol SSH-CONN

35
1.SSH-TRANS
 SSH-TRANS provides an encrypted
channel for communication. It runs on top
of a TCP connection.
 Client and server establish secure channel
by first having the client authenticate the
server using RSA.
o Server informs the client of its public key
at the time of connection
o Client warns the user when it tries to
connect to the server for the first time,
since it does not know the server

36
3. Once authenticated, the client and server
establish a session key that they will use to
encrypt any data sent over the channel.
o Client remembers the server's public key
o For future connection, the client compares
server's response with the saved key.
4. SSH-TRANS includes a negotiation of the
encryption algorithm the two sides are
going to use. For example, AES is commonly
selected. SSH-TRANS include a message
integrity check of all data exchanged over
the channel. 37
2.SSH-AUTH
1. Server is authenticated during setup of SSH-TRANS channel
by default
2. User can authenticate using any of the three mechanism
1) Login with username and password. Password is sent in
encrypted form
2) Public key encryption by asking the user to store user's
public key on the server
3) Host based authentication requires the client to be
authenticated when it connects to server for the first time.
Further connection from a trusted host is believed to be
from the same user.
3. In UNIX,
o /.ssh/known_hosts records the keys for all the hosts the
user has logged into
o /.ssh/authorized_keys contains the public keys needed to
authenticate the user when he or she logs into this machine
o /.ssh/identity contains the private keys for authenticating
38
user on remote machine
3.SSH-CONN

1. SSH can be extended to support insecure TCP applications


such as X Windows, IMAP mail readers, etc using SSH-
CONN.
2. Insecure applications are run by tunneling through SSH,
known as port forwarding.
o Client on host A communicates with server on host B using
SSH.
o Client data sent through SSH is encrypted at sender side
o The receiving SSH at well-known port decrypts the contents
o Content is forwarded to the actual port on which the server
is listening
 

39

You might also like