Four application modes of symmetric encryption algorithms

Source: Internet
Author: User

 

Encryption mode (English name and abbreviation)

Chinese name

Electronic code book (ECB)

Electronic cryptographic book Mode

Cipher Block Chaining (CBC)

Password group connection mode

Cipher Feedback mode (CFB)

Encrypted feedback mode

Output Feedback mode (ofB)

Output Feedback Mode

 

ECB: the most basic encryption mode, which is usually known as encryption. The same plaintext is always encrypted into the same ciphertext without an initial vector, which is vulnerable to password-based replay attacks, generally, it is rarely used.


CBC: Before the plaintext is encrypted, it must perform an exclusive or operation with the preceding ciphertext before encryption. Therefore, if you select different initial vectors and encrypt the same ciphertext, different ciphertext will be formed, this is currently the most widely used model. The ciphertext after CBC encryption is context-related, but the plaintext errors are not transmitted to subsequent groups. However, if one group is lost, all subsequent groups will be voided (synchronization errors ).


CFB: similar to the self-synchronous sequence password. After grouping encryption, the ciphertext and plain text are moved to different or in eight-bit groups, and the output is returned to the shift register at the same time, the advantage is minimal. encryption and decryption can be performed in bytes or N-bit. CFB is also context-related. In CFB mode, an error in plaintext will affect the ciphertext (error spread ).


OfB: The group password is run as the synchronization sequence password, which is similar to CFB. However, ofB uses the previous N-bit ciphertext output group to return to the shift register. ofB has no error spread problem.

 

ECB model

_______________________
My name | is Denny |. Wu
-----------------------


CFB Model

P0 P1 C0 C1
|
| ---- | --->...
IV ---> XOR | --->... key dec | Dec
|
|
Key ENC | IV ---> XOR | ---> XOR
| ----- |
|
C0 C1 P1 P2
Encryption and decryption process

CBC Model

 

References:

Http://blog.chinaunix.net/u/12313/showart_185319.html

Http://blog.csdn.net/gongchaoxiong/archive/2006/05/16/741122.aspx

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.