|
1 | | -<p>Encryption operation mode and the padding scheme should be chosen appropriately to guarantee data confidentiality, integrity and authenticity:</p> |
| 1 | +<p>Encryption operations should use a secure mode and padding scheme so that confidentiality and integrity can be guaranteed.</p> |
2 | 2 | <ul> |
3 | 3 | <li> For block cipher encryption algorithms (like AES): |
4 | 4 | <ul> |
| 5 | + <li> The ECB (Electronic Codebook) cipher mode doesn’t provide serious message confidentiality: under a given key any given plaintext block |
| 6 | + always gets encrypted to the same ciphertext block. This mode never be used. </li> |
| 7 | + <li> The CBC (Cipher Block Chaining) mode by itself provides only data confidentiality. This cipher mode is also vulnerable to <a |
| 8 | + href="https://en.wikipedia.org/wiki/Padding_oracle_attack">padding oracle attacks</a> when used with padding. Using CBC along with Message |
| 9 | + Authentication Code can provide data integrity and should prevent such attacks. In practice the implementation has many pitfalls and it’s |
| 10 | + recommended to avoid CBC with padding completely. </li> |
5 | 11 | <li> The GCM (Galois Counter Mode) mode which <a href="https://en.wikipedia.org/wiki/Galois/Counter_Mode#Mathematical_basis">works |
6 | 12 | internally</a> with zero/no padding scheme, is recommended, as it is designed to provide both data authenticity (integrity) and confidentiality. |
7 | 13 | Other similar modes are CCM, CWC, EAX, IAPM and OCB. </li> |
8 | | - <li> The CBC (Cipher Block Chaining) mode by itself provides only data confidentiality, it’s recommended to use it along with Message |
9 | | - Authentication Code or similar to achieve data authenticity (integrity) too and thus to <a |
10 | | - href="https://en.wikipedia.org/wiki/Padding_oracle_attack">prevent padding oracle attacks</a>. </li> |
11 | | - <li> The ECB (Electronic Codebook) mode doesn’t provide serious message confidentiality: under a given key any given plaintext block always gets |
12 | | - encrypted to the same ciphertext block. This mode should not be used. </li> |
13 | 14 | </ul> </li> |
14 | 15 | <li> For RSA encryption algorithm, the recommended padding scheme is OAEP. </li> |
15 | 16 | </ul> |
|
0 commit comments