TLS/SSL Explained: TLS/SSL Terminology and Basics

In Part 1 this series we asked, What is TLS/SSL? In this part in the series, we will be describing some of the TLS/SSL terminologies.

Before diving deeper into TLS, let’s first have a look at the very basics of SSL/TLS. Understanding the following will help you gain a better understanding of the topics discussed and analyzed later on.

Encryption

Encryption is the process in which a human-readable message (plaintext) is converted into an encrypted, non-human-readable, format (ciphertext). The main purpose of encryption is to ensure that only an authorized receiver will be able to decrypt and read the original message. When unencrypted data is exchanged between two parties, using any medium, a third-party can intercept and read the communication exchanged.

If the exchange contains sensitive information, that implies a loss of confidentiality. Furthermore, if the third-party can intercept and read the messages, they might as well tamper with the data which means they can change the information being exchanged thus compromising the integrity of the message.

Imagine sending a payment over an unencrypted channel. The payment includes your bank account details as well as the amount that you authorized. An attacker could use a man-in-the-middle attack to tamper the information and change the amount from $100 to $10,000. The bank receives the tampered data from the third-party instead of you which means that there is no authenticity. By using encryption, an attacker might still be able to intercept the traffic but they will not be able to read or tamper the data.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Symmetric Encryption

Symmetric encryption is the process in which the same key is used for encrypting and decrypting data.

If Thomas wants to send information to Bob, he will use a shared key to encrypt the data and Bob will decrypt the data using the same key.

TLS/SSL Explained: TLS/SSL Terminology and Basics

The biggest problem with symmetric key encryption is that the data exchanged must be encrypted and decrypted with the same key. That means that all of the parties exchanging data must have the shared key.

The major drawback in this is that if the shared key is exposed, an attacker would be able to decrypt all the communication encrypted with that key. That is why the shared key distribution between the parties must be done over an already established secure encrypted communication channel. Another disadvantage is that you cannot authenticate the sender of a message, which compromises authenticity.

Advantages of Symmetric Encryption

  • Fast, low resource usage.
  • Simple operation.
  • Secure.

Disadvantages of Symmetric Encryption

  • Same key used for encryption/decryption.
  • Key distribution must be done over an already established, secure channel.
  • A different key is needed for different parties – key management/distribution.
  • Cannot authenticate users.

Asymmetric Encryption

Unlike symmetric key encryption, asymmetric encryption (also referred to as Public Key Cryptography) uses a pair of keys, a public key, and a private key. These cryptographic keys are uniquely related which means that whatever is encrypted with one key, can be decrypted with the other. The public key, as the name implies, can be shared with anyone. The private key must be known only to the server.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Asymmetric encryption can be used for authentication of the sender. If Bob signs and encrypts a message using his private key, whoever decrypts it with Bob’s public key can be sure that Bob is the sender.

This is why keeping a private key secure is critical.

Advantages of Asymmetric Encryption

  • Key distribution is easy.
  • Authenticity.
  • Integrity.
  • Secure.

Disadvantages of Asymmetric Encryption

  • Slower than symmetric encryption.
  • Needs more resources.

Ciphers

Ciphers are methods/algorithms used to encrypt and decrypt data.

Block Ciphers

In this method, data is split into fixed-length blocks and then encrypted (e.g. 64-bit or 128-bit blocks). If the last block of the data is less than the specified block length, padding will be used to fill the “empty” space. Popular Block Ciphers include AES, Blowfish, 3DES, DES, and RC5.

Padding

Block ciphers have a specified fixed length and most of them require that the input data is a multiple of their size. It is common that the last block contains data that does not meet this requirement. In this case, padding (usually random data) is used to bring it to the required block length.

Initialization Vector (IV)

An Initialization Vector is a random (or pseudorandom) fixed-size input used in encryption methods. If this input is not repetitive on each message, then, it is also called as a nonce, which means that it can only be used once.

The main purpose of an IV is to start off an encryption method. In Cipher Modes, like Cipher Block Chaining (CBC), where each block is XORed with the previous block, in the first block there is no previous block to XOR with, so an Initialization Vector is used as an input to the first block to start off the process.

A nonce is also used to prevent attackers from decrypting all messages by guessing the IV. A nonce, which should be random and unpredictable, allows the same message to be encrypted with the same key and yet have a different result (ciphertext).

XOR (Exclusive Or)

XOR is an easy to implement logical function which is used in cryptography (among its many other uses). XOR takes two-bit patterns and it returns true only if the two inputs are different.

Input 1 Input 2 OUTPUT
0 0 0
1 0 1
0 1 1
1 1 0

The following is an example of an XOR encrypt operation.

Message Hello! 01001000 01000101 01001100 01001100 01001111 00100001
Key S3CR3T 01010011 00110011 01000011 01010010 00110011 01010100
Ciphertext 00011011 01110110 00001111 00011110 01111100 01110101

The following is an example of an XOR decrypt operation.

Ciphertext 00011011 01110110 00001111 00011110 01111100 01110101
Key S3CR3T 01010011 00110011 01000011 01010010 00110011 01010100
Message Hello! 01001000 01000101 01001100 01001100 01001111 00100001

Block Cipher Algorithms

Electronic Code Book (ECB)

Each block of data is encrypted separately and concatenated at the end. A major drawback of ECB is that if the same block of data is encrypted, it will always generate the same ciphertext. Parallel processing is possible since blocks do not depend on one another.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Cipher Block Chaining (CBC)

Each block is XORed with the previous ciphertext before encryption. An Initialization Vector is needed for the first plaintext block encryption to happen. Parallel processing is not possible since the blocks are chained.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Cipher Feedback (CFB)

Turns a block cipher into stream cipher by selecting a number of bits to XOR on each iteration.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Output Feedback (OFB)

Similar to CFB, but instead of the result of XOR, the result of crypto goes to the next iteration.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Counter Mode (CTR)

Each block has a nonce and an iteration counter which is first encrypted and then XORed with a plaintext block. Then the nonce changes and the counter increments on each iteration.

TLS/SSL Explained: TLS/SSL Terminology and Basics

Stream Ciphers

Stream ciphers are ciphers that use a method of encryption that encrypts data one bit or byte at a time. Each bit is encrypted with a different key. While stream ciphers are not used much in modern cryptography, a popular example of a stream cipher is the RC4 cipher.

Message Authentication Code (MAC)

Message Authentication Code (or Cryptographic Checksum) is a method which is used to check the authenticity as well as the integrity of a message. It accepts two input parameters, a secret key and a message of arbitrary length, and the result is called a tag.

TLS/SSL Explained: TLS/SSL Terminology and Basics
If the MAC tag of the sender and the calculated MAC tag of the receiver match, that means that the message has not been tampered with. If they do not match that means that the message has been altered during the transmission.

Hash-Based Message Authentication Code (HMAC)

HMAC is a type of MAC which uses a hash function. It accepts two input parameters, a secret key, and a message of arbitrary length.

The following is an example of HMAC function using the SHA256 hash algorithm.

HMAC_SHA256("s3cr3tk3y","Hello World") = 2d9615ee921dab63c7c4c839842703fe338db46fdf17593a681bcee2c52721de

The following illustration shows how the HMAC function works.

TLS/SSL Explained: TLS/SSL Terminology and Basics

文章来源于互联网:TLS/SSL Explained: TLS/SSL Terminology and Basics

发布者:小站,转转请注明出处:http://blog.gzcity.top/4257.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022年5月3日 18:09
下一篇 2022年5月3日 18:09

相关推荐

  • Steps to Building Authentication and Authorization for RESTful APIs

    One of the challenges to building any RESTful API is having a well thought out authentication and authorization strategy. Concerns like authentication, security, and logging are al…

    安全 2022年5月3日
    734690
  • A Simple Blockchain in Java

    I鈥檓 sure we all have heard about cryptocurrency and blockchain and how interrelated they are, which is true too, but they are actually very different and can exist independently. C…

    安全 2022年5月3日
    52540
  • Angular + React: Vulnerability Cheatsheet

    Securing applications is not the easiest thing to do. An application has many components: server-side logic, client-side logic, data storage, data transportation, API, and more. Wi…

    安全 2022年5月3日
    843110
  • XSS Prevention Cheatsheet

    XSS, or Cross-Site Scripting, is one of the most common vulnerabilities found in applications. In bug bounty programs of different organizations, XSS consistently ranks as the most…

    安全 2022年5月3日
    1.2K360
  • Everything About HTTPS and SSL (Java)

    Many articles, papers, and blogs have already talked about HTTPS, SSL, and web security. Nevertheless, people still miss the basics. In this article, I tried to put all things toge…

    2022年5月3日
    712660

回复 1win_rbpi

您的邮箱地址不会被公开。 必填项已用 * 标注

评论列表(64条)

  • www.binance.com sign up
    www.binance.com sign up 2024年11月21日 16:10

    Your article helped me a lot, is there any more related content? Thanks!

  • binance
    binance 2025年2月2日 18:07

    Your article helped me a lot, is there any more related content? Thanks!

  • 1win_myol
    1win_myol 2025年2月26日 14:12

    1win official [url=https://www.vbfc.uz]https://www.vbfc.uz[/url] .

  • mostbet kg_fcei
    mostbet kg_fcei 2025年2月27日 16:27

    мостбет кыргызстан [url=http://mostbet17.com.kg]мостбет кыргызстан[/url] .

  • 1win_xiSr
    1win_xiSr 2025年2月27日 18:51

    1 win kg [url=https://www.1win38.com.kg]https://www.1win38.com.kg[/url] .

  • 1win_foSr
    1win_foSr 2025年2月28日 01:01

    1вин сайт [url=1win40.com.kg]1вин сайт[/url] .

  • 1win_sfPn
    1win_sfPn 2025年2月28日 07:08

    1 win официальный сайт вход [url=https://1win39.com.kg]https://1win39.com.kg[/url] .

  • 1win_wgKr
    1win_wgKr 2025年2月28日 12:01

    win 1 [url=https://www.1win33.com.kg]https://www.1win33.com.kg[/url] .

  • 1win_sepa
    1win_sepa 2025年2月28日 19:06

    1вин официальный сайт [url=http://1win35.com.kg]1вин официальный сайт[/url] .

  • mostbet_waEr
    mostbet_waEr 2025年2月28日 19:15

    1win rossvya [url=http://mostbet18.com.kg]http://mostbet18.com.kg[/url] .

  • mostbet_tlkt
    mostbet_tlkt 2025年2月28日 23:48

    mostbet сайт [url=www.mostbet3015.ru]www.mostbet3015.ru[/url] .

  • mostbet_gmpi
    mostbet_gmpi 2025年3月1日 06:12

    mostbet telefon orqali kirish [url=mostbet3016.ru]mostbet3016.ru[/url] .

  • mostbet_vcmi
    mostbet_vcmi 2025年3月3日 00:57

    1 вин [url=www.1win36.com.kg]www.1win36.com.kg[/url] .

  • mostbet_pakl
    mostbet_pakl 2025年3月3日 06:18

    mostbet uz skachat [url=http://mostbet3019.ru/]http://mostbet3019.ru/[/url] .

  • 1win_tmpr
    1win_tmpr 2025年3月3日 09:52

    1win méxico [url=www.1win2.com.mx]www.1win2.com.mx[/url] .

  • 1win_kher
    1win_kher 2025年3月3日 09:58

    1вин rossvya [url=https://www.1win37.com.kg]https://www.1win37.com.kg[/url] .

  • 1win_raoi
    1win_raoi 2025年3月3日 14:53

    1win кыргызстан [url=http://1win41.com.kg/]http://1win41.com.kg/[/url] .

  • mostbet_fmki
    mostbet_fmki 2025年3月4日 17:24

    скачат мостбет [url=https://mostbet19.com.kg/]https://mostbet19.com.kg/[/url] .

  • 1win_arSr
    1win_arSr 2025年3月4日 17:35

    1 win.kg [url=www.1win46.com.kg]1 win.kg[/url] .

  • mostbet_drKi
    mostbet_drKi 2025年3月4日 22:49

    мостбет кг [url=https://mostbet20.com.kg/]мостбет кг[/url] .

  • 1win_hlSi
    1win_hlSi 2025年3月5日 02:36

    казино 1win [url=https://1win101.com.kg/]https://1win101.com.kg/[/url] .

  • mostbet_stEl
    mostbet_stEl 2025年3月5日 02:37

    1win букмекер [url=https://www.mostbet21.com.kg]https://www.mostbet21.com.kg[/url] .

  • 1win_yoKa
    1win_yoKa 2025年3月5日 08:33

    1win скачать kg [url=https://1win100.com.kg]https://1win100.com.kg[/url] .

  • 1win_djMn
    1win_djMn 2025年3月5日 14:35

    1 ван вин [url=https://1win102.com.kg]1 ван вин[/url] .

  • 1win_dxoa
    1win_dxoa 2025年3月5日 14:41

    официальный сайт 1 вин [url=http://1win108.com.kg/]http://1win108.com.kg/[/url] .

  • 1win_obst
    1win_obst 2025年3月5日 20:31

    1wi [url=https://1win42.com.kg]https://1win42.com.kg[/url] .

  • 1win_jgKl
    1win_jgKl 2025年3月6日 05:09

    1win на телефон [url=svstrazh.forum24.ru/?1-18-0-00000135-000-0-0-1741169701]svstrazh.forum24.ru/?1-18-0-00000135-000-0-0-1741169701[/url] .

  • mostbet_yzei
    mostbet_yzei 2025年3月6日 14:41

    мостбет зеркало [url=http://chesskomi.borda.ru/?1-10-0-00000277-000-0-0-1741171219/]http://chesskomi.borda.ru/?1-10-0-00000277-000-0-0-1741171219/[/url] .

  • 1win_pdKi
    1win_pdKi 2025年3月6日 15:01

    1хwin [url=https://www.aqvakr.forum24.ru/?1-3-0-00001121-000-0-0]1хwin[/url] .

  • 1win_hqkn
    1win_hqkn 2025年3月6日 20:52

    что такое 1win [url=http://cah.forum24.ru/?1-13-0-00001560-000-0-0-1741172791/]http://cah.forum24.ru/?1-13-0-00001560-000-0-0-1741172791/[/url] .

  • 1win_zhkn
    1win_zhkn 2025年3月7日 00:55

    1win официальный [url=https://www.aktivnoe.forum24.ru/?1-8-0-00000254-000-0-0-1741273702]https://www.aktivnoe.forum24.ru/?1-8-0-00000254-000-0-0-1741273702[/url] .

  • 1win_kzel
    1win_kzel 2025年3月7日 01:14

    1 win pro [url=1win109.com.kg]1win109.com.kg[/url] .

  • 1win_vqsl
    1win_vqsl 2025年3月7日 07:03

    1win онлайн [url=https://1win10.am]1win онлайн[/url] .

  • 1win_faei
    1win_faei 2025年3月7日 15:23

    1вин сайт [url=https://1win110.com.kg]https://1win110.com.kg[/url] .

  • 1win_womr
    1win_womr 2025年3月7日 15:29

    1win kg [url=http://1win103.com.kg/]http://1win103.com.kg/[/url] .

  • 1win_aqkt
    1win_aqkt 2025年3月7日 20:40

    1win pro [url=https://1win111.com.kg]https://1win111.com.kg[/url] .

  • 1win_ozSr
    1win_ozSr 2025年3月8日 15:07

    1wiin [url=https://1win11.am/]https://1win11.am/[/url] .

  • 1win_llpi
    1win_llpi 2025年3月8日 15:16

    1win сайт online [url=https://www.1win13.am]https://www.1win13.am[/url] .

  • 1win_ydPt
    1win_ydPt 2025年3月8日 20:34

    1win live [url=https://1win12.am/]https://1win12.am/[/url] .

  • 1win_musi
    1win_musi 2025年3月9日 01:01

    1 win casino [url=https://1win3.com.mx/]https://1win3.com.mx/[/url] .

  • 1win_eosr
    1win_eosr 2025年3月9日 01:14

    1win [url=https://1win5.com.mx/]https://1win5.com.mx/[/url] .

  • 1win_bhPr
    1win_bhPr 2025年3月9日 06:53

    1win méxico [url=http://1win4.com.mx/]http://1win4.com.mx/[/url] .

  • 1win_srsa
    1win_srsa 2025年3月10日 14:20

    1 win bet [url=https://www.1win9.com.ng]https://www.1win9.com.ng[/url] .

  • 1win_crKt
    1win_crKt 2025年3月10日 15:07

    one win [url=http://1win104.com.kg/]http://1win104.com.kg/[/url] .

  • mostbet_noei
    mostbet_noei 2025年3月10日 22:26

    поддержка мостбет [url=www.mostbet34.com.kg]www.mostbet34.com.kg[/url] .

  • binance
    binance 2025年3月11日 03:06

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  • 1win_ivPr
    1win_ivPr 2025年3月11日 14:20

    1 win bet [url=https://1win10.com.ng]https://1win10.com.ng[/url] .

  • 1win_rbpi
    1win_rbpi 2025年3月11日 15:07

    1вин вход [url=www.1win105.com.kg]www.1win105.com.kg[/url] .

  • mostbet_piEi
    mostbet_piEi 2025年3月11日 22:54

    мостбет войти [url=www.mostbet1009.com.kg]www.mostbet1009.com.kg[/url] .

  • mostbet_cdOn
    mostbet_cdOn 2025年3月12日 02:17

    мостбет кыргызстан скачать [url=www.mostbet1010.com.kg]мостбет кыргызстан скачать[/url] .

  • 1win_zspl
    1win_zspl 2025年3月12日 02:53

    1 win казино [url=https://www.1win106.com.kg]https://www.1win106.com.kg[/url] .

  • mostbet_kg_numr
    mostbet_kg_numr 2025年3月12日 10:45

    mostbet kg отзывы [url=http://mostbet1000.com.kg]http://mostbet1000.com.kg[/url] .

  • 1win_kvst
    1win_kvst 2025年3月13日 00:22

    1win pariuri [url=https://1win5000.ru/]1win pariuri[/url] .

  • 1win_rzEr
    1win_rzEr 2025年3月13日 01:19

    1 win.kg [url=https://1win107.com.kg/]https://1win107.com.kg/[/url] .

  • mostbet_zjel
    mostbet_zjel 2025年3月13日 09:29

    мосбет [url=http://mostbet1001.com.kg]http://mostbet1001.com.kg[/url] .

  • 1win_pdka
    1win_pdka 2025年3月13日 14:20

    1win.com.ci [url=1win5001.ru]1win5001.ru[/url] .

  • mostbet_umPi
    mostbet_umPi 2025年3月13日 14:31

    мостбет авиатор [url=https://mostbet1003.com.kg/]https://mostbet1003.com.kg/[/url] .

  • mostbet_kmoi
    mostbet_kmoi 2025年3月13日 14:35

    служба поддержки мостбет номер телефона [url=www.mostbet1002.com.kg]www.mostbet1002.com.kg[/url] .

  • 1win_wxEt
    1win_wxEt 2025年3月14日 01:46

    1win казино [url=www.cah.forum24.ru/?1-19-0-00000716-000-0-0-1741702224]www.cah.forum24.ru/?1-19-0-00000716-000-0-0-1741702224[/url] .

  • 1win_fopi
    1win_fopi 2025年3月14日 01:51

    1win com [url=www.aktivnoe.forum24.ru/?1-2-0-00000100-000-0-0-1741701286]www.aktivnoe.forum24.ru/?1-2-0-00000100-000-0-0-1741701286[/url] .

  • mostbet_yamt
    mostbet_yamt 2025年3月14日 01:53

    motsbet [url=www.dubna.myqip.ru/?1-18-0-00000145-000-0-0-1741708632]www.dubna.myqip.ru/?1-18-0-00000145-000-0-0-1741708632[/url] .

  • mostbet_kgoi
    mostbet_kgoi 2025年3月14日 12:24

    mostbet apk скачать [url=https://aktivnoe.forum24.ru/?1-8-0-00000260-000-0-0-1741701879/]https://aktivnoe.forum24.ru/?1-8-0-00000260-000-0-0-1741701879/[/url] .

  • 1win_pipi
    1win_pipi 2025年3月14日 12:28

    официальный сайт 1 вин [url=http://aktivnoe.forum24.ru/?1-8-0-00000259-000-0-0-1741701621]официальный сайт 1 вин[/url] .

  • mostbet_ubpl
    mostbet_ubpl 2025年3月14日 12:36

    мрстбет [url=www.cah.forum24.ru/?1-19-0-00000715-000-0-0-1741702061]мрстбет[/url] .