Little things…

Raspberry Pi is a single-board computer. It is small, low-power, and is likely to be vulnerable to a range of attacks such as ddos. But the one I am thinking about at the moment relates to encryption.

The question revolves around the computing power of the RPi 3B+, an inexpensive board I have and which I hope to be using in a small server farm – and I hope to be moving to an even wimpier—on the scale of MIPS—little computer if I can get the 3B+s running. Can a low-power computer successfully manage secure communications, both now and in the near future?

One way to get a grasp of the challenge is to engage in some pre-computing. For example, to perform the initial hand-shake in some encrypted communications the machines perform a Diffie-Hellman-Merkle key exchange[en.WP]. The exact details vary, but the idea is to create an encrypted communications using public keys which is computationally very expensive to reverse-engineer.

And it can be reversed. Due to certain leaked documents it is known the US Government, at least, has developed tools to do so and routinely does. But by increasing the complexity of the keys used one can exponentially increase the ‘cost’ of listening-in. By increasing the length of the Diffie-Hellman-Merkle from 1024 to 2048 bits, the estimated pre-computational cost of attacking it rose 109[WeakDH pdf]. Which is probably why 4096 bit is very common.

The problem is all communications using the internet are assumed to be recorded for posterity via such government programs as PRISM[en.WP]. And the government is doing this because of Moore’s Law[R].  If that 109 increase in difficulty existed before the source was written (2015), then that difficulty is now, call it 6 years later,  (109 / 23) comparatively. So in 20 years or so the difficulty challenge will be negligibly different for US Intelligence to read a communication sent today which they stole and kept on the off chance it might come in useful someday.

Oh, and that is a thing, although we know the US secret services spy on everyone, they are not the only ones. And not all the spies are state actors.

So, to be somewhat useless (and downright silly) how about if we pre-compute an 8192 bit key?

In practice this will likely not make the long-term communications more secure: it is so much larger that other techniques will be more successful in circumventing it. And, as with the steady march of Moore’s Law since the 1970s, so too does the science and technology of cryptography – someone is likely to find a flaw or technique within the next 20 years which obsoletes the DH key exchange at any length.

But, again, calculating such a large bit of binary data will certainly give the RPi 3B+ a challenge. How can we compare its strength? I will compare it to my 2019 Librem 13 laptop:

real 14m12.610s
user 13m29.459s
sys 0m0.178s

To be fair to the laptop, I have a ton of other things going on. You know, like a GUI, 3x browsers, VPN, etc.

In fact, I had so many other things going on I managed to break something, which caused a communications tool I need to display a blank window. Which could most-easily be resolved by rebooting.

Which ended the session I had with the little pi that couldn’t after more than 12 hours of chipping away at that 8192 bit prime number. Needless to say I had a few words with myself about failing to use screen[R] or tmux[R].

real 1610m12.927s
user 1610m1.546s
sys 0m0.781s

This, on the other hand, is the successful completion time. Yes, 1610 minutes, that is 26 hours, 50 minutes. My laptop is rather more than 100x as fast, despite the cruft, as the RPi 3B+ with Raspbian lite.

Perhaps, just maybe, the server farm is a bit of a silly idea.