eke ssl and many more

Upload: humhainvivek

Post on 09-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Eke Ssl and Many More

    1/8

    L e c t u r e N o t e s f o r C S - 5 7 8 C r y p t o g r a p h y ( S S 2 0 0 7 ) P r o f . M i c h a e l B a c k e s

    1 2 . A u t h e n t i c a t i o n M e t h o d s , S S L , a n d o t h e r I m p o r t a n t P r o t o c o l s

    L e c t u r e 1 7 S a a r l a n d U n i v e r s i t y

    T h i s c h a p t e r i n v e s t i g a t e s v a r i o u s m e t h o d s f o r u s e r a u t h e n t i c a t i o n , t y p i c a l l y t o a s e r v e r . F u r t h e r -

    m o r e , w e w i l l d i s c u s s s e v e r a l i m p o r t a n t p r o t o c o l s t h a t a r e f r e q u e n t l y u s e d i n p r a c t i c e , i n p a r t i c u l a r

    S S L / T L S .

    1 2 . 1 A u t h e n t i c a t i o n

    A u t h e n t i c a t i o n i s o n e o f t h e c r u c i a l a s p e c t s o f c o m p u t e r s e c u r i t y , e s p e c i a l l y s i n c e i t i s u s e d v e r y

    o f t e n i n d a i l y l i f e , e . g . , o n e a u t h e n t i c a t e s w h e n l o g g i n g i n t o a c o m p u t e r , w h e n c h e c k i n g e m a i l s , w h e n

    d o i n g o n l i n e b a n k i n g , a n d s o o n .

    L e t u s r s t n o t e t h a t a u t h e n t i c a t i o n i s t y p i c a l l y c o m p l e m e n t e d w i t h a k e y e x c h a n g e p r o t o c o l a s

    o t h e r w i s e a n a t t a c k e r c a n s i m p l y h i j a c k a s e s s i o n , i . e . , t a k e o v e r t h e s e s s i o n a f t e r t h e a u t h e n t i c a t i o n

    t o t h e s e r v e r h a s b e e n c o m p l e t e d , e . g . , b y c u t t i n g o y o u r c o n n e c t i o n a n d t a k i n g o v e r y o u r I P .

    1 2 . 1 . 1 P a s s w o r d A u t h e n t i c a t i o n

    P r o b a b l y t h e m o s t c o m m o n m e t h o d u s e d f o r a u t h e n t i c a t i o n i s p a s s w o r d a u t h e n t i c a t i o n . P a s s -

    w o r d s a r e e a s y t o h a n d l e , e a s y t o c a r r y w i t h y o u , a n d t h e p r i n c i p l e i s e a s y t o u n d e r s t a n d e v e n f o r

    n o n - s p e c i a l i z e d u s e r s . O n t h e o t h e r h a n d , t h e y o f t e n d o n o t p r o v i d e s u c i e n t l y s t r o n g s e c u r i t y

    g u a r a n t e e s : c o m m o n p a s s w o r d s i n p r a c t i c e t e n d t o h a v e l o w e n t r o p y ( p a s s w o r d a s a p a s s w o r d i s

    m u c h m o r e c o m m o n t h a n k 3 4 - h N ( a 1 W * ) , a n d s o m e p r o t o c o l s e v e n f u r t h e r d e c r e a s e e n t r o p y b y n o t

    a l l o w i n g s p e c i a l c h a r a c t e r s , b y t r u n c a t i n g t h e p a s s w o r d , o r b y e v e n c o n v e r t i n g t h e w h o l e p a s s w o r d

    t o u p p e r c a s e l e t t e r s .

    T h e m o s t i n t u i t i v e w a y t o r e a l i z e p a s s w o r d a u t h e n t i c a t i o n i s t o s t o r e t h e p a s s w o r d o n t h e s e r v e r ' s

    h a r d d i s k a n d t o t e s t i f t h e p a s s w o r d p r o v i d e d b y t h e u s e r m a t c h e s t h e s t o r e d p a s s w o r d . W h i l e t h i s

    s o l u t i o n s e e m s n a t u r a l , i t b e a r s t h e r i s k t h a t a n a t t a c k e r t h a t s u c c e s s f u l l y g a i n s a c c e s s t o t h e s e r v e r ' s

    h a r d d i s k c a n s i m p l y r e a d t h e p a s s w o r d a n d u s e i t f o r l a t e r a u t h e n t i c a t i n g h i m s e l f a s t h e u s e r .

    I n s t e a d o f s t o r i n g t h e p a s s w o r d i n c l e a r , s e r v e r s t y p i c a l l y s t o r e a l i s t c o n t a i n i n g e n t r i e s o f t h e

    f o r m ( A l i c e , H (P A l i c e

    )) , w h e r e P A l i c e

    i s A l i c e ' s p a s s w o r d a n d

    Hi s a o n e - w a y ( h a s h ) f u n c t i o n . T h e n

    a p a s s w o r d p r e s e n t e d b y a u s e r P i s v e r i e d b y r s t a p p l y i n g H a n d t h e n c o m p a r i n g H (P ) w i t h t h e s t o r e d h a s h o f t h e p a s s w o r d p a s s w o r d . T h u s e v e n i f a n a t t a c k e r s g e t s a c c e s s t o t h e p a s s w o r d l e , i t

    s t i l l h a s t o n d a p a s s w o r d P t h a t m a p s t o a x e d v a l u e H (P A l i c e ) u n d e r H . H e n c e a n a t t a c k e r h a s t o b r e a k t h e o n e - w a y n e s s o f t h e f u n c t i o n

    H.

    E a r l y v e r s i o n s o f W i n d o w s ( b e f o r e W i n d o w s 2 0 0 0 S P 3 ) u s e d a p a s s w o r d v e r i c a t i o n c a l l e d

    L A N M A N . I t a c c e p t e d 14 b y t e s f o r e a c h p a s s w o r d P , c o n v e r t e d t h e s e b y t e s i n t o u p p e r c a s e l e t t e r s , t h e n s p l i t t h e m i n t o t w o h a l v e s o f e q u a l s i z e P = P 1 P 2 , a n d u s e d b o t h h a l v e s a s D E S k e y s t o e n c r y p t a x e d m e s s a g e IV . T h i s m e t h o d h a s v a r i o u s w e a k n e s s e s : M o s t i m p o r t a n t l y , c o n v e r t i n g a l l l e t t e r s t o u p p e r c a s e s i g n i c a n t l y r e d u c e s t h e p a s s w o r d s e n t r o p y , t h u s p a v i n g t h e w a y f o r s u c c e s s f u l

    d i c t i o n a r y a t t a c k s . A d d i t i o n a l l y , t r u n c a t i n g p a s s w o r d s t o 14 b y t e s i s n o t g o o d , b u t m u c h w o r s e

    1

  • 8/8/2019 Eke Ssl and Many More

    2/8

    i s s p l i t t i n g t h e p a s s w o r d i n t o t w o i n d e p e n d e n t h a l v e s . T h u s a n a t t a c k e r c a n a t t a c k b o t h h a l v e s

    i n d e p e n d e n t l y , w h i c h m a k e s s u c c e s s f u l d i c t i o n a r y o r b r u t e - f o r c e a t t a c k s m u c h e a s i e r t o m o u n t .

    N o w a d a y s , W i n d o w s r e l i e s o n M D 4 h a s h e s , w h i c h c o n s t i t u t e s a m u c h b e t t e r a p p r o a c h f o r s t o r i n g

    p a s s w o r d s c o m p a r e d t o L A N M A N .

    E a r l y v e r s i o n s o f L i n u x a l l o w e d p a s s w o r d s o f 7 b y t e s o n l y ( b u t a d d i t i o n a l l y u s e d s a l t i n g t o p r o t e c t a g a i n s t d i c t i o n a r y a t t a c k s , s e e b e l o w ) , a n d u s e d t h e p a s s w o r d a s k e y f o r s e v e r a l c o n s e c u t i v e

    D E S e n c r y p t i o n s o f a x e d m e s s a g e I V .

    1 2 . 1 . 2 D i c t i o n a r y a t t a c k s

    A g e n e r i c a t t a c k a g a i n s t h a s h e d p a s s w o r d s s t o r e d i n a l e i s t h e s o - c a l l e d d i c t i o n a r y a t t a c k . T h e

    a t t a c k d o e s n o t d e p e n d o n t h e c o n c r e t e h a s h f u n c t i o n u s e d , a s l o n g a s t h e f u n c t i o n i s p u b l i c l y

    k n o w n . T h e a d v e r s a r y s t a r t s w i t h a d i c t i o n a r y o f c o m m o n w o r d s W 1 , W 2 , . . . ( s u c h d i c t i o n a r y a r e f r e e l y a v a i l a b l e o n t h e n e t ) a n d s i m p l y h a s h e s e a c h o f t h e m , i . e . , h e c o m p u t e s

    H (W 1 ), H (W 2 ), . . . , u n t i l h e n d s a h a s h H t h a t i s s t o r e d i n t h e l e . I f t h i s a p p r o a c h d o e s n o t s u c c e e d t h e n h e t r i e s t o m o d i f y t h e s e w o r d s a s a u s e r m i g h t h a v e d o n e , i . e . , b y a p p e n d i n g o r i n s e r t i n g n u m b e r s a n d s p e c i a l

    c h a r a c t e r s , b y r e v e r s i n g t h e o r d e r o f l e t t e r s , a n d s o o n .

    T h i s i s o f c o u r s e a h e u r i s t i c a t t a c k t h a t h o w e v e r t u r n s o u t t o b e s u c c e s s f u l i n p r a c t i c e i f a n

    a t t a c k e r i s s a t i s e d w i t h n d i n g a n y p a s s w o r d s t o r e d i n t h e l e ( i n p r a c t i c e e v e n m o s t p a s s w o r d s ,

    d e p e n d i n g o n t h e s o p h i s t i c a t i o n o f t h e u s e r s t o c h o o s e p a s s w o r d s , o f c o u r s e ) .

    T h i s a t t a c k c a n b e m a d e m u c h m o r e d i c u l t t o m o u n t b y s a l t i n g t h e p a s s w o r d s : i n s t e a d o f

    h a s h i n g t h e p a s s w o r d P A , o n e p i c k s a r a n d o m salt A {0, 1}l f o r e v e r y u s e r A ( a c o m m o n c h o i c e i s l = 12 ) , a n d s t o r e s

    Alice , salt A , H (salt A P A ).

    V e r i f y i n g t h e c o r r e c t n e s s o f a g i v e n p a s s w o r d c a n e a s i l y b e d o n e , a s t h e s a l t i s k n o w n t o t h e s e r v e r .

    A n a t t a c k e r , h o w e v e r , c a n n o t a t t a c k a l a r g e n u m b e r o f p a s s w o r d s s i m u l t a n e o u s l y s i n c e t h e y u s e

    d i e r e n t s a l t s . H e n c e h e h a s t o a t t a c k e a c h p a s s w o r d i n d i v i d u a l l y , r e s u l t i n g i n a m u c h l o n g e r

    c o m p u t a t i o n .

    T h e i d e a o f a d d i n g s o m e f o r m o f u n c e r t a i n t y t o t h e h a s h v a l u e c a n b e f u r t h e r e x t e n d e d b y u s i n g

    a s o - c a l l e d s e c r e t s a l t o r p e p p e r . O n e c h o o s e s salt A {0, 1}l a n d salt

    A {0, 1}k ( a c o m m o n c h o i c e i s k = 8 ) , a n d s t o r e s

    Alice , salt A , H (salt A salt

    A P A ).

    T o v e r i f y a p a s s w o r d t h e s e r v e r h a s t o t r y a l l 2k v a l u e s f o r salt A . I f t h e s e r v e r i s g i v e n a c o r r e c t p a s s w o r d , t h i s o n l y i n c r e a s e s t h e c o m p u t a t i o n t i m e f r o m m i c r o - s e c o n d s t o m i l l i - s e c o n d s , w h i c h i s

    u s u a l l y d o a b l e . T h e a t t a c k e r ' s t i m e , h o w e v e r , i s a s w e l l i n c r e a s e d b y a f a c t o r o f 2k ; h o w e v e r t h i s i s t y p i c a l l y f r o m , s a y , o n e d a y t o 2k d a y s .

    1 2 . 1 . 3 B i o m e t r i c P a s s w o r d s

    B i o m e t r i c a u t h e n t i c a t i o n m e t h o d s a r e a p r e t t y n o v e l r e s e a r c h a n d a p p l i c a t i o n a r e a . O n e c a n f o r

    e x a m p l e u s e n g e r p r i n t s , i r i s s c a n s , o r s p e e c h - r e c o g n i t i o n t o i d e n t i f y a p e r s o n . U s i n g b i o m e t r i c s a s

    p a s s w o r d s h o w e v e r s u e r s f r o m t w o m a i n p r o b l e m s : F i r s t , t h e b i o m e t r i c p a s s w o r d s a r e n o t s e c r e t ,

    e . g . , c o p i e s o f a p e r s o n ' s n g e r p r i n t s t u r n o u t t o b e e a s i l y a c h i e v a b l e i n p r a c t i c e . S e c o n d , t h e r e i s

    n o p o s s i b i l i t y t o r e v o k e a c o p i e d n g e r p r i n t ( e x c e p t b y u s i n g s u r g e r y o f c o u r s e ) .

    2

  • 8/8/2019 Eke Ssl and Many More

    3/8

    1 2 . 1 . 4 O n e - t i m e P a s s w o r d s

    T h e f o l l o w i n g a u t h e n t i c a t i o n s c h e m e , w h i c h i s d u e t o L a m p o r t , e x p l o i t s s o - c a l l e d o n e - t i m e p a s s -

    w o r d s . A l i c e g e n e r a t e s a p a s s w o r d P A , a n d c o m p u t e s W A := H n (P A ) := H (H (. . . (H (P A )) . . . )) f o r s o m e o n e - w a y f u n c t i o n

    H. T h e s e r v e r s t o r e s W A ; A l i c e s t o r e s P A a n d s e t s cnt := n . I f A l i c e w a n t s

    t o a u t h e n t i c a t e t o t h e s e r v e r , s h e d e c r e a s e s cnt := cnt 1 , s e n d s A := H cnt (P A

    ) t o t h e s e r v e r . T h e s e r v e r v e r i e s t h a t

    H (A) = W A , a n d i f s o , s e t s W A := A . T h i s s c h e m e i n p a r t i c u l a r a v o i d s e a v e s d r o p p i n g a t t a c k s s i n c e m e r e l y l i s t e n i n g o n t h e c h a n n e l w i l l o n l y r e v e a l p a s s w o r d s t h a t w o u l d

    h a v e b e e n a c c e p t e d b y t h e s e r v e r b e f o r e h e c h a n g e d i t s s t a t e a n d h e n c e t h e v a l u e o f W A . M o r e o v e r , b r e a k i n g i n t o t h e s e r v e r d o e s n o t w e a k e n t h e s c h e m e s i n c e n o s e c r e t s a r e s t o r e d o n t h e s e r v e r . T h e

    d r a w b a c k h o w e v e r i s t h a t A l i c e c a n o n l y a u t h e n t i c a t e h e r s e l f a l i m i t e d n u m b e r o f t i m e s , n a m e l y

    n t i m e s . A f t e r t h a t , t h e c h a i n o r i g i n a t i n g a t h e r p a s s w o r d h a s b e e n u s e d u p s o t h a t s h e h a s t o g e n e r a t e a n e w p a s s w o r d s , h a s h i t n t i m e s , a n d l e t t h e s e r v e r k n o w t h e n e w v a l u e W A .

    A n o t h e r s y s t e m r e l y i n g o n o n e - t i m e p a s s w o r d s i s S e c u r e I D , w h e r e t h e c l i e n t o w n s a s m a r t c a r d .

    H e r e t h e s e r v e r a n d t h e s m a r t c a r d s t a r t w i t h t h e s a m e r a n d o m v a l u e K 0 , a n d e v e r y m i n u t e t h e y c o m p u t e a n e w v a l u e K i+1 := H (K i ) . I f A l i c e w o u l d l i k e t o a u t h e n t i c a t e t o t h e s e r v e r , t h e s m a r t c a r d o u t p u t s

    DES(K i ,

    c t

    ), w h e r e c t d e n o t e s t h e c u r r e n t t i m e . W h i l e t h i s s y s t e m a l l o w s f o r u n l i m i t e d

    p a s s w o r d u s a g e , t h e d r a w b a c k i s t h a t t h e s e r v e r i s n o w r e q u i r e d t o s t o r e a s e c r e t . M o r e o v e r , t h e

    s m a r t c a r d h a s t o b e t a m p e r - r e s i s t a n t a s o t h e r w i s e s t e a l i n g t h e s m a r t c a r d , c o p y i n g i t s m e m o r y , a n d

    h a n d i n g i t b a c k u n n o t e d l y w o u l d c a u s e a s e v e r e t h r e a t t o t h i s k i n d o f s y s t e m . T h i s p r o t o c o l i s

    s e c u r e a g a i n s t e a v e s d r o p p i n g a t t a c k s a s w e l l .

    1 2 . 1 . 5 C h a l l e n g e - R e s p o n s e P r o t o c o l s

    A n o t h e r c o m m o n a u t h e n t i c a t i o n m e t h o d i s t o u s e c h a l l e n g e - r e s p o n s e p r o t o c o l s .

    B a s e d o n S y m m e t r i c K e y s A l i c e a n d t h e s e r v e r s h a r e a c o m m o n k e y K . T h e a u t h e n t i c a t i o n p r o c e d u r e c o n s t i t u t e s a t h r e e - r o u n d p r o t o c o l : A l i c e i n i t i a t e s t h e p r o t o c o l b y s e n d i n g a h e l l o m e s s a g e

    t o t h e s e r v e r . T h e s e r v e r p i c k s a r a n d o m r t h e c h a l l e n g e a n d s e n d s i t t o A l i c e . A l i c e p i c k s a r a n d o m r a n d s e n d s E (K, r r ) t o t h e s e r v e r . T h e s e r v e r d e c r y p t s t h i s e n c r y p t i o n , a n d i f t h e r s t c o m p o n e n t m a t c h e s t h e p r e v i o u s l y s e n t c h a l l e n g e r , i t c o n s i d e r s A l i c e a u t h e n t i c a t e d . T h i s p r o t o c o l r e s i s t s e a v e s d r o p p i n g a t t a c k s b u t r e q u i r e s t h e s e r v e r t o s t o r e s s e c r e t s .

    B a s e d o n P u b l i c - k e y C r y p t o g r a p h y T h e p r o t o c o l w o r k s e x a c t l y a s t h e o n e b e f o r e , b u t t o g e t h e r

    w i t h t h e h e l l o m e s s a g e , A l i c e a l s o s e n d s h e r c e r t i c a t e f o r h e r p u b l i c s i g n a t u r e k e y . I n s t e a d o f l a t e r

    e n c r y p t i n g t h e m e s s a g e w i t h a s e c r e t k e y , s h e s i g n s t h e m e s s a g e w i t h h e r s e c r e t s i g n a t u r e k e y .

    T h e s e r v e r t h e n o n l y t e s t s t h e v a l i d i t y o f t h e s i g n a t u r e , w h i c h f r e e s t h e s e r v e r f r o m s t o r i n g s e c r e t

    i n f o r m a t i o n .

    T h e S t a t i o n - t o - S t a t i o n P r o t o c o l ( S T S ) T h e S T S p r o t o c o l c o n s t i t u t e s a w i d e l y k n o w n p r o -

    t o c o l f o r a u t h e n t i c a t i o n a n d k e y e x c h a n g e . I t r e l i e s o n a l a r g e p r i m e p a n d a g e n e r a t o r g o f Z pa s p u b l i c l y k n o w n p a r a m e t e r s . A l i c e s e l e c t s a s i g n a t u r e k e y - p a i r (pk A , sk A ) a n d o b t a i n s a c e r t i - c a t e cert A f o r t h e p u b l i c k e y pk . A l i c e a n d B o b p i c k x, y R {1, . . . , p 1} , r e s p e c t i v e l y . T h e n A l i c e s e n d s (cert A , gx mod p) t o B o b , w h i c h i n t u r n s e n d s (cert S , gy , E (K, S (sk S , (gx , gy )))) w h e r e K := gxy . A l i c e a n s w e r s w i t h E (K, S (sk A , (gx , gy ))) . K c a n b e c o m p u t e d b y b o t h p a r t i e s a n d

    3

  • 8/8/2019 Eke Ssl and Many More

    4/8

    c o n s t i t u t e s t h e s h a r e d k e y . B a s e d o n t h i s s h a r e d k e y , A l i c e a n d B o b c a n s u b s e q u e n t l y a u t h e n t i c a t e

    t h e m s e l v e s t o e a c h o t h e r , e . g . , b y r u n n i n g t h e a f o r e m e n t i o n e d c h a l l e n g e - r e s p o n s e p r o t o c o l .

    1 2 . 1 . 6 E n c r y p t e d K e y E x c h a n g e ( E K E )

    T h e e n c r y p t e d k e y e x c h a n g e p r o t o c o l ( E K E ) w o r k s a s f o l l o w s . L e t

    SE AES

    = (K

    ,E

    ,D

    )d e n o t e t h e

    A E S s y m m e t r i c e n c r y p t i o n s c h e m e , a n d g b e a p u b l i c l y k n o w n g e n e r a t o r o f Z p f o r a l a r g e p r i m e p . B o t h A l i c e , t h e c l i e n t , a n d t h e s e r v e r s h a r e a p a s s w o r d pwd . T h e y c h o o s e x, y R {1, . . . , p 1} , r e s p e c t i v e l y . A l i c e s e n d s

    E (pwd , gx ) t o t h e s e r v e r , w h i c h i n t u r n s e n d s E (pwd , gy ) t o A l i c e . T h e n b o t h c o m p u t e K := gxy a s u s u a l . T h e n A l i c e s e n d s r t o t h e s e r v e r , a n d t h e s e r v e r a n s w e r s w i t h E (K, r r ) a s f o r t h e c h a l l e n g e - r e s p o n s e p r o t o c o l b a s e d o n s y m m e t r i c k e y s .

    -

    C l i e n t ( pwd ) S e r v e r ( pwd )

    x R {1, . . . , p 1} y R {1, . . . , p 1}E (pwd , gx )

    E (pwd , gy )

    K = g xy K = g xyJ a b l o n p r o p o s e d a v a r i a t i o n o f E K E i n 1 9 9 6 w h i c h w o r k s a s f o l l o w s . L e t pwd b e t h e p a s s w o r d t h a t i s e n c o d e d a s a n e l e m e n t i n

    Z p i n a s u i t a b l e w a y , a n d l e t A l i c e a n d t h e s e r v e r c h o o s e x, y R{1, . . . , p 1} r e s p e c t i v e l y . A l i c e s e n d s pwd x t o t h e s e r v e r w h i c h a n s w e r s w i t h t h e m e s s a g e pwd y . T h e n b o t h s h a r e t h e k e y pwd xy .

    -

    C l i e n t ( pwd ) S e r v e r ( pwd )

    x R {1, . . . , p 1} y R {1, . . . , p 1}pwd x

    pwd y

    K = pwd xy

    K = pwd xy

    1 2 . 2 A P r a c t i c a l P r o t o c o l : S S L / T L S

    S S L / T L S i s a p r o t o c o l f o r p r o v i d i n g s e c u r e ( i . e . , s e c r e t a n d a u t h e n t i c a t e d ) c o m m u n i c a t i o n s o v e r

    t h e I n t e r n e t . S S L 1 . 0 w a s r s t p r o p o s e d i n 1 9 9 4 b y N e t s c a p e C o m m u n i c a t i o n s a n d s u b s e q u e n t l y

    i m p r o v e d . I n 1 9 9 9 t h e c u r r e n t v e r s i o n 3 . 0 w a s r e n a m e d ( w i t h s o m e v e r y s m a l l c h a n g e s ) t o T L S 1 . 0 ,

    c a u s i n g s o m e c o n f u s i o n w i t h n a m e s a n d v e r s i o n s . I n t h e f o l l o w i n g , w e u s e t h e t e r m S S L , u n l e s s

    s t a t e d o t h e r w i s e .

    T h e S S L p r o t o c o l r s t e x c h a n g e s a s y m m e t r i c e n c r y p t i o n k e y u s i n g s l o w p u b l i c - k e y o p e r a t i o n s .

    T h e n t h e p a y l o a d d a t a i s e n c r y p t e d u s i n g a f a s t s y m m e t r i c e n c r y p t i o n s c h e m e w i t h t h e k e y t h a t

    b o t h p a r t i e s p r e v i o u s l y a g r e e d o n . D e p e n d i n g o n t h e p r o t o c o l n e e d s , S S L c a n p r o v i d e s i n g l e - s i d e d

    a u t h e n t i c a t i o n o r m u t u a l a u t h e n t i c a t i o n . T h i s i s a c h i e v e d u s i n g c e r t i c a t e s ; t h u s a u t h e n t i c a t e d

    p a r t i e s a r e r e q u i r e d t o m a i n t a i n c e r t i c a t e s . S S L s u p p o r t s , a m o n g s t o t h e r a l g o r i t h m s , P K C S # 1

    p u b l i c - k e y e n c r y p t i o n a n d d i g i t a l s i g n a t u r e s , D i e - H e l l m a n k e y e x c h a n g e , t h e s y m m e t r i c c i p h e r s

    A E S a n d 3 D E S , a n d t h e h a s h f u n c t i o n S H A - 1 . I t a l s o s u p p o r t s p r i m i t i v e s t h a t a r e n o w a d a y s

    c o n s i d e r e d o u t d a t e d s u c h a s ( s i n g l e ) D E S a n d M D 5 , b u t o n e c a n ( a n d s h o u l d ) a v o i d u s i n g t h e m .

    T h e S S L p r o t o c o l h a s t h r e e p h a s e s :

    1 . N e g o t i a t i o n o f s u p p o r t e d a l g o r i t h m s ,

    4

  • 8/8/2019 Eke Ssl and Many More

    5/8

    2 . E x c h a n g e o f a s e s s i o n k e y b y m e a n s o f p u b l i c - k e y e n c r y p t i o n a n d a u t h e n t i c a t i o n b a s e d o n

    c e r t i c a t e s , a n d

    3 . P a y l o a d e n c r y p t i o n b a s e d o n a s y m m e t r i c c i p h e r a n d t h e s e s s i o n k e y .

    1 2 . 2 . 1 O v e r a l l P r o t o c o l

    A c l i e n t s t a r t s a s e s s i o n b y s e n d i n g a c l i e n t _ h e l l o m e s s a g e i n c l u d i n g a r a n d o m s t r i n g c - r a n d

    o f l e n g t h

    28 b i t s , a s e s s i o n I D , a n d b y s p e c i f y i n g t h e c r y p t o g r a p h i c p r i m i t i v e s i t s u p p o r t s i n c i p h e r - s p e c s . T h e s e r v e r r e s p o n d s w i t h a s e r v e r _ h e l l o m e s s a g e , i n c l u d i n g a n o t h e r r a n d o m s t r i n g s - r a n d , t h e s e s s i o n

    I D , a n d s p e c i f y i n g t h e p r i m i t i v e s t h a t w i l l b e u s e d i n t h e s e q u e l s e l e c t e d f r o m t h e o n e s s p e c i e d b y

    t h e c l i e n t .

    -C l i e n t S e r v e r

    ( c l i e n t _ h e l l o , s e s s i o n - i d , c - r a n d , c i p h e r - s p e c s )

    C l i e n t S e r v e r

    ( s e r v e r _ h e l l o , s e s s i o n - i d , s - r a n d , c i p h e r - s p e c )

    T o b e a b l e t o v e r i f y a c e r t i c a t e , t h e p a r t i e s n e e d t o s u p p o r t t h e c r y p t o g r a p h i c p r i m i t i v e s t h a t w e r e

    u s e d , e . g . , R S A s i g n a t u r e s o r D S A s i g n a t u r e s . T h u s , i t m i g h t b e n e c e s s a r y t o h a v e a v a r i e t y o f c e r -

    t i c a t e s u s i n g d i e r e n t p r i m i t i v e s . N o w t h a t b o t h p a r t i e s a g r e e d o n t h e p a r a m e t e r s , t h e y e x c h a n g e

    a s u i t a b l e c e r t i c a t e . F o r m o s t a p p l i c a t i o n s i t i s s u c i e n t t h a t o n l y t h e s e r v e r a u t h e n t i c a t e s t o t h e

    u s e r , i n w h i c h c a s e o n l y t h e s e r v e r s e n d s i t s c e r t i c a t e t o t h e u s e r . C u r r e n t l y a l l c e r t i c a t e s f o l l o w

    t h e X . 5 0 9 s t a n d a r d , b u t t h e r e e x i s t s a d r a f t f o r u s i n g O p e n P G P - b a s e d c e r t i c a t e s .

    C l i e n t S e r v e r

    (server _ cert , c e r t )

    I n t h e n e x t s t e p t h e k e y e x c h a n g e t a k e s p l a c e . T h e r e a r e d i e r e n t o p t i o n s h o w t o e x c h a n g e a k e y ;

    t w o o f t h e m w e w i l l d i s c u s s l a t e r . I n e i t h e r c a s e , a f t e r n i s h i n g t h i s s t e p b o t h p a r t i e s s h a r e a

    s o - c a l l e d p r e - m a s t e r s e c r e t PMS , a 40- b i t s e c r e t k e y w h i c h i s t h e n u s e d t o d e r i v e t h e m a s t e r k e y .

    -C l i e n t S e r v e r

    k e y - e x c h a n g e

    T h i s p r e - m a s t e r s e c r e t i s t h e n u s e d t o d e r i v e a s o - c a l l e d m a s t e r - s e c r e t a s

    H (PMS , c - r a n d , s - r a n d ) . T h e f u n c t i o n

    Hi s d e n e d b y r s t s p l i t t i n g i t s i n p u t i n t w o h a l v e s , i t e r a t i v e l y a p p l y i n g M D 5 t o

    t h e r s t h a l f a n d S H A - 1 t o t h e s e c o n d h a l f , a n d X O R i n g t h e o u t p u t s . E x t r a c a r e h a s t o b e t a k e n

    s i n c e t h e o u t p u t l e n g t h o f S H A - 1 i s d i e r e n t f r o m t h e o u t p u t l e n g t h o f M D 5 , t h u s t h e n u m b e r

    o f i t e r a t i o n s f o r b o t h f u n c t i o n s d i e r s . T h i s m a s t e r - s e c r e t i s t h e n u s e d t o d e r i v e t h e ( s y m m e t r i c )

    e n c r y p t i o n a n d a u t h e n t i c a t i o n k e y s a s n e e d e d . F i n a l l y , b o t h p a r t i e s a c k n o w l e d g e t h e s u c c e s s f u l k e y

    e x c h a n g e .

    C l i e n t S e r v e r

    (nish )

    -C l i e n t S e r v e r

    (nish )

    1 2 . 2 . 2 K e y E x c h a n g e I : E n c r y p t e d S e c r e t

    A v e r y s i m p l e v a r i a n t f o r r e a l i z i n g t h e k e y e x c h a n g e i s t h e f o l l o w i n g o n e : t h e c l i e n t c h o o s e s a r a n d o m

    b i t s t r i n g o f 48 b i t s , e n c r y p t s i t w i t h t h e s e r v e r ' s p u b l i c k e y ( w h i c h i s k n o w n f r o m t h e c e r t i c a t e ) c E (pk , r ) , a n d s e n d s t h e r e s u l t i n g c i p h e r t e x t t o t h e s e r v e r .

    5

  • 8/8/2019 Eke Ssl and Many More

    6/8

    T h i s i s r e a s o n a b l y f a s t , a s o n l y o n e p u b l i c - k e y o p e r a t i o n n e e d s t o b e p e r f o r m e d b y e a c h p a r t y .

    H o w e v e r , i t d o e s n o t p r o v i d e f o r w a r d s e c r e c y , i . e . , i f a t s o m e p o i n t t h e s e r v e r ' s k e y i s c o m p r o m i s e d ,

    a n a t t a c k e r c a n u s e i t t o o b t a i n a l l p a s t s e s s i o n k e y s a n d t h u s t o r e a d a n y c o m m u n i c a t i o n o f t h e

    s e r v e r w i t h a n y c l i e n t . T h i s i s o f c o u r s e n o t o p t i m a l , a n d t h e r e a r e b e t t e r w a y s t o d o i t .

    -C l i e n t S e r v e r

    ( c l i e n t - k e y - e x c h a n g e , c)

    1 2 . 2 . 3 K e y E x c h a n g e I I : E p h e m e r a l D i e - H e l l m a n ( E D H )

    T h e f o l l o w i n g k e y e x c h a n g e p r o v i d e s f o r w a r d s e c r e c y , i . e . , i f a t s o m e t i m e t h e s e r v e r ' s k e y g e t s

    c o m p r o m i s e d , t h e n a n a d v e r s a r y c a n o n l y r e a d f u t u r e c o m m u n i c a t i o n u s i n g t h i s k e y . H e n c e , i f

    t h e a t t a c k w a s n o t i c e d , o n e c a n s i m p l y a v o i d u s i n g t h i s k e y a n d a l m o s t n o h a r m i s d o n e . T h i s

    i m p r o v e m e n t , h o w e v e r , c o m e s a l o n g w i t h a r u n n i n g t i m e w h i c h i s t h r e e t i m e s s l o w e r t h a n t h e

    r u n n i n g t i m e o f t h e p r e v i o u s m e t h o d .

    F i r s t , t h e s e r v e r c h o o s e s a r a n d o m 1024 b i t p r i m e p a n d a g e n e r a t o r g o f Z p . I t f u r t h e r m o r e c h o o s e s

    a R {1, . . . , p 1}, a n d c o m p u t e s

    z1 = ga

    mod p. T h e n i t s i g n s

    ( p,g,z 1 )y i e l d i n g a

    s i g n a t u r e sig , a n d s e n d s sig t o t h e c l i e n t . T h e c l i e n t i n t u r n v e r i e s t h e s i g n a t u r e sig , p i c k s a r a n d o m b R {1, . . . , p 1} , c o m p u t e s z2 = zb1 mod p , a n d s e n d s i t b a c k t o t h e s e r v e r .

    C l i e n t S e r v e r

    ( s e r v e r - k e y - e x c h a n g e , p ,g , z 1 , sig )

    -C l i e n t S e r v e r

    ( c l i e n t - k e y - e x c h a n g e , z 2 )

    B o t h t h e c l i e n t a n d t h e s e r v e r c a n c o m p u t e t h e p r e - m a s t e r s e c r e t PMS := gab . T h i s i s a l m o s t a D i e - H e l l m a n k e y e x c h a n g e , b u t t h e s e r v e r ' s s i g n a t u r e p r e v e n t s a n a t t a c k e r f r o m d o i n g a m a n - i n -

    t h e - m i d d l e a t t a c k , s i n c e h e c a n n o t s i g n t h e v a l u e z1 .

    1 2 . 2 . 4 I m p r o v i n g P e r f o r m a n c e : S S L R e s u m e

    A n i c e f e a t u r e o f S S L i s t h e s o - c a l l e d S S L r e s u m e , w h i c h i m p r o v e s p e r f o r m a n c e b y a v o i d i n g u n n e c -

    e s s a r y k e y - e x c h a n g e o p e r a t i o n s . I f a c l i e n t a n d a s e r v e r h a v e c o m m u n i c a t e d b e f o r e u s i n g t h e s e s s i o n

    I D CSID , t h e n t h e c l i e n t s i m p l y s e n d s a c l i e n t - h e l l o m e s s a g e w i t h t h i s s e s s i o n I D .

    -C l i e n t S e r v e r

    ( c l i e n t _ h e l l o , C S I D , c - r a n d , c i p h e r - s p e c s )

    I f t h e s e r v e r c a n n d t h i s s e s s i o n i n h i s s e s s i o n c a c h e , t h e n h e a n s w e r s w i t h t h e s a m e CSID , o t h e r w i s e w i t h a f r e s h s e s s i o n I D .

    C l i e n t S e r v e r

    ( s e r v e r _ h e l l o , C S I D , s - r a n d , c i p h e r - s p e c )

    C l i e n t S e r v e r

    ( s e r v e r _ h e l l o , n e w - s e s s i o n - i d , s - r a n d , c i p h e r - s p e c )

    I f r e s u m e w a s s u c c e s s f u l , b o t h t h e u s e r a n d t h e s e r v e r r e u s e t h e i r p r e v i o u s P M S a n d s e n d a n

    a c k n o w l e d g e m e s s a g e .

    6

  • 8/8/2019 Eke Ssl and Many More

    7/8

    C l i e n t S e r v e r

    (nish )

    -C l i e n t S e r v e r

    (nish )

    T h e m a s t e r - s e c r e t , w h i c h i s t h e n u s e d t o a c t u a l l y d e r i v e k e y s , i s g e n e r a t e d a s

    H (PMS c - r a n d s - r a n d ) .

    1 2 . 2 . 5 S S L i n P r a c t i c e

    L e t u s b r i e y t a l k a b o u t n e t w o r k i n g p r o b l e m s o f S S L t h a t o c c u r i n p r a c t i c e . C o m m o n l y , b i g w e b

    s i t e s a r e d e s i g n e d a s f o l l o w s : F i r s t , a s e r v e r s i d e c a c h e t r i e s t o a n s w e r c o m m o n q u e r i e s t o s t a t i c

    d a t a . T h e n a l o a d b a l a n c e r b a l a n c e s t r a c b e t w e e n d i e r e n t w e b s e r v e r s ; t h e w e b s e r v e r s a r e n a l l y

    c o n n e c t i n g t o t h e c e n t r a l d a t a b a s e .

    F i r s t o f a l l , f o r u s i n g S S L o n e n e e d s t o i n s t a l l t h e k e y s o n a l l w e b s e r v e r s , w h i c h i s n o t o p t i m a l

    f r o m a s e c u r i t y p o i n t o f v i e w , a s t h i s i n c r e a s e s t h e r i s k o f k e y e x p o s u r e . F u r t h e r m o r e , t h e p r e v a l e n t

    c h o i c e o f R S A e n c r y p t i o n i s n o t o p t i m a l , a s t h e w e b s e r v e r s h a v e t o p e r f o r m R S A d e c r y p t i o n

    o p e r a t i o n s t h a t a r e m o r e t i m e - c o n s u m i n g t h a n R S A e n c r y p t i o n o p e r a t i o n s . C u r r e n t l y , t h e r e a r e

    s t r o n g e o r t s t o s p e e d u p S S L , e . g . , b y u s i n g s p e c i a l i z e d h a r d w a r e .

    A n o t h e r p o i n t i s t h a t c a c h i n g a s d e s c r i b e d i s n o t p o s s i b l e i f t h e c o n t e n t i s e n c r y p t e d , a s t h e c a c h e

    c a n n o t s e e w h a t i s i n s i d e t h e p a c k e t s . T h i s , h o w e v e r , c a n n o t b e a v o i d e d w i t h e n c r y p t e d c o n t e n t .

    O n e m o r e p r o b l e m o c c u r s f o r w e b s e r v e r s t h a t h o s t d i e r e n t d o m a i n s a t t h e s a m e I P a d d r e s s . I n

    t h i s s e t t i n g , t h e w e b s e r v e r d i s t i n g u i s h e s t h e d o m a i n s b y t h e H T T P h e a d e r s . W i t h S S L , h o w e v e r ,

    t h e u s e r a n d s e r v e r e x c h a n g e c e r t i c a t e s b e f o r e a n y H T T P r e q u e s t w a s m a d e , i . e . , t h e s e r v e r c a n n o t

    k n o w f o r w h i c h d o m a i n i t s h o u l d p r o v i d e t h e c e r t i c a t e . T h i s w a s x e d w i t h T L S 1 . 1 b y i n c l u d i n g

    t h e h o s t a d d r e s s i n t h e c l i e n t _ h e l l o m e s s a g e .

    A n o t h e r p r o b l e m a r i s e s w h e n e n c r y p t e d c o m m u n i c a t i o n p a s s e s a p r o x y s e r v e r . H e r e g e t - r e q u e s t s

    a r e r s t s e n t t o a p r o x y t h a t f o r w a r d s t h e m t o t h e s e r v e r . I f S S L i s t u r n e d o n , t h e p r o x y d o e s n o t

    k n o w w h e r e t o c o n n e c t t o , a s t h e s e r v e r ' s n a m e i s e n c r y p t e d . F o r t h i s r e a s o n H T T P S p e r m i t s

    a n a d d i t i o n a l r s t m e s s a g e w h i c h c o n t a i n s t h e t a r g e t h o s t n a m e a s p a r a m e t e r ; t h e n n o r m a l S S L

    m e s s a g e s a r e e x c h a n g e d .

    1 2 . 2 . 6 U s e r A u t h e n t i c a t i o n

    I f u s e r a u t h e n t i c a t i o n i s d e s i r e d , t h e p r o t o c o l s l i g h t l y d e v i a t e s f r o m w h a t w a s s t a t e d a b o v e : I n t h e

    s e r v e r _ h e l l o m e s s a g e t h e s e r v e r i n c l u d e s a d i r e c t i v e c e r t - r e q a n d a l i s t o f a c c e p t e d c e r t i c a t e s .

    C l i e n t S e r v e r

    ( s e r v e r _ h e l l o , . . . , c e r t - r e q , l i s t o f a c c e p t e d C A s )

    T h e n t h e c l i e n t s e n d s a n a p p r o p r i a t e c e r t i c a t e t o t h e s e r v e r .

    -C l i e n t S e r v e r

    ( c l i e n t _ c e r t , cert )

    T h e n , a f t e r t h e r e m a i n i n g p r o t o c o l , t h e c l i e n t s i g n s a l l p r o t o c o l d a t a w i t h h i s s e c r e t k e y a n d s e n d s

    i t t o t h e s e r v e r , w h i c h v e r i e s t h e s i g n a t u r e .

    -C l i e n t S e r v e r

    ( c e r t _ v e r i f y , S (sk , A l l p r o t o c o l d a t a ))

    7

  • 8/8/2019 Eke Ssl and Many More

    8/8

    1 2 . 3 A q u i c k r e v i e w o f K e r b e r o s , P G P , I P S E C , a n d S S H

    W e n o w b r i e y r e v i e w s o m e m o r e p r o t o c o l s t h a t a r e i m p o r t a n t i n p r a c t i c e .

    1 2 . 3 . 1 K e r b e r o s

    K e r b e r o s i s a w e l l - k n o w n s y s t e m f o r s y m m e t r i c k e y e x c h a n g e o v e r a c e n t r a l a u t h o r i t y . I t o r i g i n a t e d

    f r o m t h e A t h e n a p r o j e c t a t M I T f o r s e c u r e d i s t r i b u t e d s y s t e m s a r o u n d 1 9 8 7 . I t i s t h e n a m e o f a

    p r o t o c o l s t a n d a r d a s w e l l a s o f a l i b r a r y o f c o m m a n d s . I t u s e s t h e t e r m t i c k e t s f o r s e r v e r m e s s a g e s

    t h a t c a n b e u s e d t o d e r i v e s e s s i o n k e y s f o r t h e u s e r s .

    1 2 . 3 . 2 P r e t t y G o o d P r i v a c y ( P G P )

    P G P i s p r o b a b l y t h e b e s t - k n o w n p r o g r a m f o r e n c r y p t i n g m a i l s a n d l e s i n t h e p r i v a t e s e c t o r , a s i t

    i s f r e e - o f - c h a r g e f o r p r i v a t e u s e . I t h a s v a r i o u s a p p l i c a t i o n s f o r e n c r y p t i n g e m a i l s a n d l e s , a n d a l s o

    p r o v i d e s t r a n s p a r e n t e n c r y p t i o n o f t h e l e s y s t e m ( P G P - D i s k ) . I t w a s p u b l i s h e d r s t i n 1 9 9 1 b y

    P h i l Z i m m e r m a n n . A t t h a t t i m e s t r i c t U S e x p o r t r e g u l a t i o n s p r e v e n t e d t h e e x p o r t o f c r y p t o g r a p h y

    w i t h k e y s l a r g e r t h a n 40 b i t s . T o c i r c u m v e n t t h i s r e s t r i c t i o n h e p r i n t e d a b o o k w h i c h c o n t a i n e d t h e w h o l e s o u r c e - c o d e o f t h e p r o g r a m , a n d d i s t r i b u t e d t h i s b o o k a r o u n d t h e w o r l d , w h i c h s u r p r i s i n g l y

    w a s l e g a l . T h e n o t h e r p e o p l e s c a n n e d i n t h e s o u r c e c o d e a n d r e - c o m p i l e d t h e p r o g r a m . F o r t u n a t e l y ,

    n o w a d a y s t h e e x p o r t r e g u l a t i o n s a r e g o n e , a n d t h e p r o g r a m i s a v a i l a b l e f r e e l y . P G P c a n b e u s e d

    w i t h a v a r i e t y o f a l g o r i t h m s , i n c l u d i n g R S A a n d E l G a m a l f o r a s y m m e t r i c e n c r y p t i o n , R S A a n d

    D S A d i g i t a l s i g n a t u r e s , s y m m e t r i c e n c r y p t i o n a l g o r i t h m s I D E A a n d 3 D E S , a n d h a s h f u n c t i o n s

    M D 5 , S H A - 1 , a n d S H A - 2 5 6 .

    1 2 . 3 . 3 I P S E C

    I P S E C i s a c r y p t o g r a p h i c p r o t o c o l f o r s e c u r i n g I P c o m m u n i c a t i o n a n d k e y e x c h a n g e . I t o p e r a t e s

    o n t h e n e t w o r k l a y e r , i . e . , l o w e r t h a n t h e a f o r e m e n t i o n e d p r o t o c o l s , s o i t i s m o r e g e n e r a l l y u s a b l e .

    E v e n t h e u s u a l h e a d e r s c a n b e a u t h e n t i c a t e d . H o w e v e r , h e a d e r e l d s s u c h a s h o p - c o u n t m a y c h a n g e

    w h e n a p a c k e t i s s e n t t r o u g h t h e I n t e r n e t ; t h e s e e l d s a r e s e t t o 0 b e f o r e h e a d e r s a r e a u t h e n t i c a t e d . T w o m o d e s a r e s u p p o r t e d b y I P S E C : T r a n s p o r t m o d e , w h e r e o n l y p a y l o a d d a t a i s e n c r y p t e d , a n d

    t u n n e l m o d e , w h e r e t h e w h o l e p a c k a g e i n c l u d i n g t h e h e a d e r i s e n c r y p t e d , a n d w h e r e n e w h e a d e r s

    a r e a d d e d .

    1 2 . 3 . 4 S S H ( S e c u r e S h e l l )

    T h e r s t v e r s i o n o f S S H , a l s o c a l l e d S S H - 1 , w a s d e s i g n e d i n 1 9 9 5 b y T a t u Y l n e n f r o m t h e U n i v e r s i t y

    o f H e l s i n k i a s a r e s p o n s e t o a p a s s w o r d - s n i n g a t t a c k a t h i s u n i v e r s i t y . I t p r o v i d e s a r e p l a c e m e n t f o r

    p r o t o c o l s s u c h a s t e l n e t a n d r l o g i n , w h i c h t r a n s m i t p a s s w o r d s i n c l e a r t e x t a n d w h i c h a r e t h u s h i g h l y

    v u l n e r a b l e t o s n i n g a t t a c k s . I n 1 9 9 6 S S H - 1 w a s i m p r o v e d s i g n i c a n t l y , y i e l d i n g t h e c u r r e n t l y u s e d

    v e r s i o n S S H - 2 . S o m e o f t h e s e c h a n g e s , h o w e v e r , c a u s e d b o t h v e r s i o n s t o b e i n c o m p a t i b l e . S i n c e

    s u c c e s s f u l a t t a c k s a g a i n s t S S H - 1 h a v e b e e n d i s c o v e r e d , t h i s v e r s i o n s h o u l d n o t b e u s e d a n y m o r e

    a n y w a y . W h i l e S S H i s k n o w n b e s t f o r i t s s e c u r e s h e l l , i t a l s o p r o v i d e s o t h e r t o o l s s u c h a s S C P a s

    a r e p l a c e m e n t f o r t h e i n s e c u r e r e m o t e c o p y ( r c p ) c o m m a n d , a n d o p t i o n s f o r t u n n e l i n g , e . g . , X 1 1

    s e s s i o n s .

    8