pgpfan:seip
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pgpfan:seip [2024/09/11 22:42] – [SEIP for TLS] We are not doing advocacy here. b.walzer | pgpfan:seip [2026/03/14 17:55] (current) – [The Output Feedback (OFB) Block Cipher Mode] Missed a detail. b.walzer | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| //< | //< | ||
| - | We start with a 128 bit Initialization Vector (IV) (any previously unused 128 bits) and encrypt it using the key to produce the first 128 bits of the Bitstream. Then we take the first segment of the Bitstream and encrypt it. We encrypt the IV over and over again until we have a long enough Bitstream. Then we XOR the Bitstream with the Plaintext to produce the Ciphertext. The interesting thing here is that we are not actually using the encryption function to encrypt anything we care about. We are using the encryption function to do something else and then use that result to do the actual encryption. We don't even need a separate decryption function for OFB. When we want the plaintext back we just use the key to generate the Bitstream again and XOR it with the Ciphertext. That is based on a helpful property of the XOR function. If you XOR something with the same bitstream twice, you end up with what you started with. | + | We start with a 128 bit Initialization Vector (IV) (any previously unused 128 bits) and encrypt it using the key to produce the first 128 bits of the Bitstream. Then we take the first segment of the Bitstream and encrypt it. We encrypt the IV over and over again until we have a long enough Bitstream. Then we XOR the Bitstream with the Plaintext to produce the Ciphertext. The interesting thing here is that we are not actually using the encryption function to encrypt anything we care about. We are using the encryption function to do something else and then use that result to do the actual encryption. We don't even need a separate decryption function for OFB. When we want the plaintext back we just use the key and IV to generate the Bitstream again and XOR it with the Ciphertext. That is based on a helpful property of the XOR function. If you XOR something with the same bitstream twice, you end up with what you started with. |
| The OFB mode has a fairly serious failure possibility. If you use the same IV and key on two or more messages then you get the same bitstream which causes, essentially, | The OFB mode has a fairly serious failure possibility. If you use the same IV and key on two or more messages then you get the same bitstream which causes, essentially, | ||
| Line 40: | Line 40: | ||
| //< | //< | ||
| - | The original IV is replaced with zeros and the IV is shifted down to the first part of the message. Encrypting zeros is a common way to generate a new key from the existing key. For example, the popular [[wp> | + | The original IV is replaced with zeros and the IV is shifted down to the first part of the message. Encrypting zeros is a common way to generate a new key from the existing key. For example, the popular [[wp> |
| {{ocfb_hash_se.svg}}\\ | {{ocfb_hash_se.svg}}\\ | ||
| Line 104: | Line 104: | ||
| ===Creation=== | ===Creation=== | ||
| - | {{seip_cre.svg}} | + | {{seip_cre.svg}}\\ |
| //< | //< | ||
| Line 111: | Line 111: | ||
| This sort of attack is not possible in the case of SEIP. The attacker can get the victim to create a new MDC for them (the MDC is not protected against creation). The secret IV is not encrypted in the same way as the Plaintext (and is thus protected). If the attacker embeds an entire valid message, IV and all, inside the message the victim creates for them, then the IV will eventually get decrypted in a different way than it was encrypted. Alternatively, | This sort of attack is not possible in the case of SEIP. The attacker can get the victim to create a new MDC for them (the MDC is not protected against creation). The secret IV is not encrypted in the same way as the Plaintext (and is thus protected). If the attacker embeds an entire valid message, IV and all, inside the message the victim creates for them, then the IV will eventually get decrypted in a different way than it was encrypted. Alternatively, | ||
| - | If the attacker knows the secret IV then they can probably create a new and valid message. So IV disclosure is significant at this level of threat. | + | If the attacker knows the secret IV then they can probably create a new and valid message. So IV disclosure is significant at this level of threat. |
| + | |||
| + | If an attacker could somehow come up with an encrypted suffix with appropriately encrypted MDC, splicing that suffix on the end of an existing message to extend it would result in a block of damage. The MDC would pick that block up and fail the modification detection in a way the attacker | ||
| ====Luck==== | ====Luck==== | ||
| Line 131: | Line 133: | ||
| I have to admit that this seems more straightforward than all the stuff about protection. But be careful here. Most are not very knowledgeable about the properties of a MAC buried under the encryption. A MAC is most often used where the material being MACed and the MAC tag are available to the attacker. That is not the case here. I would like to think that the protection discussion is better for ultimately understanding //why// things work the way they do verses //what// results things provide. That was certainly the case for me while developing the protection discussion. | I have to admit that this seems more straightforward than all the stuff about protection. But be careful here. Most are not very knowledgeable about the properties of a MAC buried under the encryption. A MAC is most often used where the material being MACed and the MAC tag are available to the attacker. That is not the case here. I would like to think that the protection discussion is better for ultimately understanding //why// things work the way they do verses //what// results things provide. That was certainly the case for me while developing the protection discussion. | ||
| - | It should be pointed out that SEIP, while using a hash, is not an [[wp> | + | It should be pointed out that SEIP, while using a hash, is not an [[wp> |
| - | The CFB damage amplification | + | The topic of key committing block cipher modes is popular right now (2024)((Much of the excitement seems to have come from: [[https:// |
| ====Hash Properties==== | ====Hash Properties==== | ||
| Line 171: | Line 173: | ||
| Up to this point we assumed a cipher with 128 bit blocks. The OpenPGP standard supports ciphers with 64 bit blocks. Use of a 64 bit cipher in a SEIP formatted message would result in the secret IV only being 64 bits long. So the strength of the modification detection would be reduced. It's not clear to me that SEIP with 64 bit blocks is something that anyone ever implemented and that such messages/ | Up to this point we assumed a cipher with 128 bit blocks. The OpenPGP standard supports ciphers with 64 bit blocks. Use of a 64 bit cipher in a SEIP formatted message would result in the secret IV only being 64 bits long. So the strength of the modification detection would be reduced. It's not clear to me that SEIP with 64 bit blocks is something that anyone ever implemented and that such messages/ | ||
| + | |||
| + | A bit of insight from this discussion... The damage amplification of CFB is helpful here but would not have been as helpful if " | ||
| [[pgpfan: | [[pgpfan: | ||
pgpfan/seip.1726094543.txt.gz · Last modified: by b.walzer
