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