Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

7

The other answers are great, but I wanted to call out an interesting feature of modern cryptography. Your question asked: I thought, why even use AES or DES or any other complex way for encrypting data when there are far simpler ways, like just generating a random (pseudorandom) bitstream, and XOR'ing it with the data or secret message? In point of fact, ...


2

...random enough.. Let's just focus on that as it forms the nub of your question. Yes,$$\text{random (pseudorandom) bitstream} \oplus \text{secret message}$$ is very simple, works and is in common usage. But the first term in this encryption function masks great (and necessary) complexity. In order to be secure, the bitstream must comprise independent ...


10

We use more complex encryption algorithms than XOR with a random or pseudo-random keystream for a number of reasons: In order to get a short secret key in symmetric encryption. XOR with a true random stream (One Time Pad) requires storing or/and transfering a secret keystream the size of the data to encipher, which is utterly impractical. Replacing the ...


4

You could use a one-time pad, which does grant confidentiality when properly employed, but then you would have many non-trivial problems: Your message or messages would have to be quite short because generating letters in a truly random manner usually takes a bit of time and effort (rolling dice). One-time pads only have limited practical use. You cannot ...


1

What you're describing would be a One-Time-Pad. The OTP would actually be perfectly secure, but the first problem is in the issue that you have to generate a bit stream using a cryptographically secure pseudorandom number generator (CSPRNG) instead of a usual pseudorandom number generator. But even that doesn't pose a particularly large problem. Keep also in ...


3

There are many assumptions in your question, and most of them are often not correct. The messages cannot be intercepted. If this is true then you simply don't need cryptography at all, your communication is already secure. You use cryptography when you're not sure that it is already secure. The messages cannot be altered If this is true then you don't ...


4

The OTP does not provide message integrity, wasn't designed too and almost certainly can't. The OTP is a model that formalizes the notion of confidentiality. A System providing integrity should to do so for every correct instantiation of such system. It is however trivial to show correct instantiations of OTP that do not provide integrity. A remark on ...


6

But, if you and I have a one-time symmetric key, and I send you a message, and it is not complete gibberish, is that itself not message authentication? The informal criterion of "not complete gibberish" that you are applying here has two problems: Malleability: It is trivial to modify OTP-encrypted ciphertexts so that they will decrypt to something that's ...


3

get one that decodes to something resembling what you expect to get. You don't always expect the exact detail though. You might transmit "Buy 1 million shares in ...", but the other end might receive "Buy 5 million shares in ..." due to malice or a noisy channel. One altered/corrupted bit might easily decode to something entirely sensible as I've shown. ...


1

As a follow up to Paul Uszak's method of using a camera, I have analyzed that method for generating TRNG output, and if done correctly, it is sound, this works best with a DSLR that has a removable lens. A Sony A-6000 series camera is a good option. There are essentially 2 sources for camera input, visible light and radiation that causes the sensor to think ...


0

Flip a coin 256 times and write down the result as tthttttthhhtthhtttht…. Expand it by your favorite modern KDF—say, HKDF-SHA256 or SHAKE128, or SHA-256 followed by ChaCha—into 4000 characters. (Using a KDF or hashing first smooths out any slight nonuniformity of the coin tosses.) You can verify that the computation was done correctly by redoing it on ...


1

Upon careful reflection, I suggest the following three alternatives. They are in increasing order of effort. 1. Get the 4000 bytes from a blocking implementation of \dev\random. That will generate information theoretic secure output within an hour of computer usage as the entropy will come from your mouse and key strokes. You won’t have to do anything ...


1

There is a very practical way to do something essentially equivalent to storing a long one-time pad: store a 32-byte key $k$, and when you need a page of pad material, take the first 32 bytes of $\operatorname{ChaCha}(k)$ as a new key, replacing $k$ in memory, and the remaining bytes—up to about a zettabyte—as your pad. Voilà! As long as you overwrite the ...


Top 50 recent answers are included