SSL (Secure Socket Layer)

Introduction to SSL (Secured Socket Layer)

SSL एक network protocol होता है जो client और server के बीच authentication और communication को manage करता है। SSL के 3 primary task है।

  • Client authentication
  • Server authentication
  • Communication encryption

SSL एक web server और browser के बीच में secure connection establish करता है। SSL Netscape के द्वारा develop किया गया था। SSL को RFC 2246 में declare किया गया है। इसे TLS (Transport Layer Security) के नाम से भी जाना जाता है।

इस protocol का सबसे important task applications के बीच data की privacy और completeness provide करना है। जब भी कोई connection SSL के साथ secure किया जाता है तो उसकी 3 characteristics होती है। ये characteristics निचे दी जा रही है।

  • Privacy - Connection private होता है क्योंकि transmit होने वाले data को Symmetric Cryptography से encrypt किया जाता है। ये एक algorithm होती है जो data को encrypt करती है।
  • Authenticity - Communicate करने वाली applications authentic होती है। क्योंकि public-key cryptography से उन्हें authenticate किया जाता है।
  • Reliability - Connection reliable होता है क्योंकि हर message की completeness authentication code के द्वारा check की जाती है।

Components of SSL

SSL के 4 primary component (protocols) होते है। SSL को इन 4 protocols में divide किया गया हैं।

  • SSL handshake protocol
  • SSL record protocol
  • SSL alert protocol
  • SSL change cipher spec protocol

इन सभी protocols के बारे में detail से निचे दिया जा रहा है।

SSL Handshake Protocol

SSL hand shake protocol के द्वारा client और server के बीच में secure channel establish किया जाता है। ये protocol keys और algorithms की information SSL record protocol को provide करता है। इस protocol के द्वारा clients और servers 3 primary tasks perform करते है।

  • Clients और servers cryptographic algorithm determine करते है। ये वो algorithm होती है जिससे data encrypt किया जायेगा। जब client और server दोनों किसी एक algorithm को support करते है तो उसे ही choose किया जाता है।
  • Clients और servers एक दूसरे को authenticate करते है।
  • एक दूसरे के साथ keys exchange करते है ताकि दूसरी तरफ data का decryption किया जा सके।

SSL Record Protocol

SSL record protocol data का fragmentation, compression और encryption करता है। इस property के functions निचे explain किये जा रहे है।

  • Application layer से प्राप्त data को fixed length के packets में break करना।
  • Data को compress करना।
  • Message Authentication Code (MAC) add करना।
  • Break किये गए packets को encrypt करना।
  • सभी packets के साथ SSL header attach करना।

SSL Alert Protocol

SSL alert protocol sessions में आने वाली problems (errors) को alert messages के द्वारा represent करता है। एक alert message में error की गंम्भीरता और उसके बारे में short description दिया जाता है। जब भी कोई fatal error message मिलता है तो server और client दोनों ही connection को close कर देते है। जब connection को close किया जाता है तो इसी protocol के माध्यम से client और server एक दूसरे को notify करते है। इसके लिए close_notify message भेजा जाता है। ये protocols warnings भी present करता है।

SSL Change Cipher Spec Protocol

Change cipher spec protocol client और server के द्वारा यूज़ किये जाने वाले encryption method को change करने के लिए यूज़ किया जाता है। Change cipher protocol एक single message होता है जो ये बताता है की sender symmetric key encryption को change करना चाहता है। ये एक message होता है जिसमे 1 byte value 1 set होती है। इस protocol के advantage ये है की दोबारा connection establish किये बिना ही आप encryption method को change कर सकते है।

Working of SSL (Secured Socket Layer)

जब भी client server के बीच में connection होता है तो ये एक initial handshake process के द्वारा start होता है। सबसे पहले server अपना digital certificate client को present करता है। Client इस certificate को public key cryptography के द्वारा authenticate करता है। ये certificate बताता है server एक authorized server है। Server के authenticate होने के बाद client भी खुद को authenticate करता है।

जब एक बार server authenticate हो जाता है तो client और server encryption method determine करते है। जैसा की मैने आपको पहले बताया सिर्फ वही encryption method यूज़ किया जाता है जिसे client और server दोनों support करते हो। साथ ही एक common key भी share की जाती है जो data के decryption के लिए यूज़ की जाती है।

जब भी आप किसी SSL secure connection में enter करते है तो protocol HTTP से HTTPS बन जाता है।

आइये इस process को कुछ steps से समझने का प्रयास करते है।

  1. सबसे पहले handshake protocol के द्वारा client और server एक दूसरे को authenticate करते है।
  2. इसके बाद change cipher spec protocol के द्वारा encryption method set किया जाता है।
  3. इसके बाद SSL record protocol के द्वारा SSL को packets में break किया जाता है, compress किया जाता है और SSL header attach किया जाता है। फिर ये packets TCP को भेज दिए जाते है।
  4. यदि इस process के दौरान कोई error आती है तो alert protocols इन errors को present करता है।
  5. साथ ही alert protocol के द्वारा connection terminate करने के लिए message भी भेजा जाता है।