3 ms·
My blind stab at it is this encryption always produces an output that's not validated to be what was originally encrypted and it does so in a way you could even
by zamadatix 3y ago
My blind stab at it is this encryption always produces an output that's not validated to be what was originally encrypted and it does so in a way you could even intentionally damage a specific portion of the data without needing to know how to decrypt it.
Curious to see how wrong I am :).
- Polycryptus 3y agoThat's right, there's no guarantee the data hasn't been tampered with after encryption. The mechanics of the tampering you could do depend on the cipher mode you use. To give a simplified example (which doesn't match what this program does but is useful to demonstrate), ECB is the simplest mode (which really shouldn't be used for anything). Your input is split into fixed-length blocks (16 bytes for AES) and each block is encrypted separately, producing a deterministic ciphertext for each block. (e.g. a block of all "A" will always encrypt to the same thing). So if an attacker is able to figure out what plaintext a block of encrypted data corresponds to, they could use that knowledge to build a "fake" encrypted message. They could also remove blocks from a message, or shuffle them around. If you're interested in playing around more practically with this kind of thing, I highly recommend the https://cryptopals.com/ https://cryptopals.com/ challenge sets.
- Levitating 3y agoI just finished the first 11 challenges, including detecting ECB ciphers. Thank you for sharing these! They are very fun and interesting challenges.
- SV_BubbleTime 3y agoIt’s this. A cipher with a MAC or authentication (like an AEAD) will return “TRUE” and the data that was definitely decrypted properly. A normal cipher just returns data and it has no idea if it was decrypted correctly, so if you decrypt ABC and it should be XYZ, the wrong key will still “work” but the data will be X@9 which means nothing to you. Normally, you would validate your data after encryption. Like using something “Here is my result, and it has to start with the ascii characters of a valid date.” An authenticated cipher allows you to not care or have to know anything about the data at all, they’re nice. With the downside that you also need to supply the MAC or TAG or SIG along with the data package.