utilizing both:
- MIC or HMAC - is a short piece of info used to provide authentication/integrity of a message
- encryption - is encoding a message to provide confidentiality
Orders of MAC & Encryption
- Encrypt-then-MAC is the most ideal scenario. Any modifications to the cipher-text that do not also have a valid MAC code can be filtered out before decryption, protecting against any attacks on the implementation. The MAC cannot, also, be used to infer anything about the plain-text
- MAC-then-Encrypt and Encrypt-and-MAC both provide different levels of security, but not the complete set provided by Encrypt-then-MAC
|
Order |
Description |
Example |
|---|---|---|
|
Encrypt-and-MAC (EaM) aka MAC-and-Encrypt (MaE) |
compute the MAC on the plain-text, encrypt the plain-text, and then append the MAC at the end of the cipher-text
|
That’s what Secure Shell (SSH) does |
|
MAC-then-Encrypt (MtE) |
compute the MAC on the plain-text, append it to the data, and then encrypt the whole
|
That’s what SSL does |
|
Encrypt-then-MAC (EtM) most ideal scenario |
encrypt the plain-text, then compute the MAC on the cipher-text, and append it to the cipher-text (In that case, we do not forget to include the initialization vector (IV) and the encryption method identifier into the MAC-ed data.)
|
That’s what IPSec does |