Hacker News new | past | comments | ask | show | jobs | submit

Cracking a 512-bit DKIM key for less than $8 in the cloud

https://dmarcchecker.app/articles/crack-512-bit-dkim-rsa-key
loading story #42633965
loading story #42638507
Could someone help me understand why we're not dramatically ramping up key sizes across the board on all encryption? Not as a solution, but as a buy-some-time measure.

Compute is rapidly increasing, there is continuous chatter about quantum and yet everyone seems to be just staring at their belly buttons. Obviously bigger keys are more expensive in compute, but we've got more too...why only use it on the cracking side, but not on defense?

Even simple things like forcing TLS 1.3 instead of 1.2 from client side breaks things...including hn site.

Old but still relevant: https://www.schneier.com/blog/archives/2009/09/the_doghouse_...

  These numbers have nothing to do with the technology of the devices; they are the maximums that thermodynamics will allow. And they strongly imply that brute-force attacks against 256-bit keys will be infeasible until computers are built from something other than matter and occupy something other than space.
Long story short, brute forcing AES256 or RSA4096 is physically impossible
That’s true for AES-256. But brute force attacks are not the most efficient way to attack RSA, so it’s not true in that case. (Eg quantum computers would break RSA-4096 but not AES-256).
loading story #42648800
We are. 1024-bit keys are being retired across cryptosystems everywhere, and have been for over a decade (don't get me started on the one laggard). Nothing threatens 2048 bit keys other than QC, which threatens RSA altogether. Progress isn't linear; it's not like 2048 falls mechanically some time after 1024 (which itself is not practical to attack today).
People might be assuming that 2048-bits is only twice as strong as 1024-bits, but it's in fact a billion times better. (corrected, thanks!)
That would be true if RSA scaled proportionally with the number of bits, but the exponent involved is much lower than 1. 1024->2048 gives you around the same difficulty as adding 30 bits to a symmetric key.
I stand corrected, thanks! 2^30 still means a billion times better.
It's also only true so long as we don't discover more efficient ways of factoring large numbers. We haven't come up with any dramatic improvements lately, but it's always possible that something will come up. Symmetric crypto systems like AES are on much firmer ground, as they don't depend as heavily on the difficulty of any single mathematical problem.
loading story #42638989
we are definitely not.

most countries registrar's won't support DNS hacks requied for larger dkim.

we still use the minimum key size in most countries.

What? Just use normal name servers. The registrar doesn't matter one bit, they delegate the zone to whatever name servers you specify. Those can serve whatever records properly.
{"deleted":true,"id":42636844,"parent":42635278,"time":1736359975,"type":"comment"}
Probably because RSA 2048 is not yet broken, and once there we still have RSA 4096 to lean back on which is since quite some time the most common key size for most things using RSA (DKIM being one of the exceptions).

In the context of DKIM we're waiting for Ed25519 to reach major adoption, which will solve a lot of annoyances for everyone.

> Probably because RSA 2048 is not yet broken […]

3072 has been recommended by various parties for a few years now:

* https://www.keylength.com

Is there a compelling reason to use 3072 instead of 4096? If you're going to kick the can down the road you might as well put some effort into it. The difference in memory use/compute time has to be marginal at this point. It's not like the old days when jumping from 512 to 4096 made the encryption unusably slow.
There's no good reason at all, which is why RSA-3072 is the rarely seen "oddball".
> There's no good reason at all

Operations per second?

* https://wiki.strongswan.org/projects/strongswan/wiki/PublicK...

Running MacPorts-installed `openssl speed rsa` on an Apple M4 (non-Pro):

    version: 3.4.0
    built on: Tue Dec  3 14:33:57 2024 UTC
    options: bn(64,64)
    compiler: /usr/bin/clang -fPIC -arch arm64 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DNDEBUG -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    CPUINFO: OPENSSL_armcap=0x87d
                       sign    verify    encrypt   decrypt   sign/s verify/s  encr./s  decr./s
    rsa   512 bits 0.000012s 0.000001s 0.000001s 0.000016s  80317.8 973378.4 842915.2  64470.9
    rsa  1024 bits 0.000056s 0.000003s 0.000003s 0.000060s  17752.4 381404.1 352224.8  16594.4
    rsa  2048 bits 0.000334s 0.000008s 0.000009s 0.000343s   2994.9 117811.8 113258.1   2915.6
    rsa  3072 bits 0.000982s 0.000018s 0.000019s 0.000989s   1018.4  54451.6  53334.8   1011.3
    rsa  4096 bits 0.002122s 0.000031s 0.000032s 0.002129s    471.3  31800.6  31598.7    469.8
    rsa  7680 bits 0.016932s 0.000104s 0.000107s 0.017048s     59.1   9585.7   9368.4     58.7
    rsa 15360 bits 0.089821s 0.000424s 0.000425s 0.090631s     11.1   2357.4   2355.5     11.0
(Assuming you have to stick with RSA and not go over to EC.)
loading story #42638386
loading story #42637095
RSA 2048 isn't broken, but experts consider it a matter of time. How long I don't know, but since the attacks are known (prime numbers) someone (read not me) can make an estimate with error bars that are concerning enough to consider it as good as broken.
loading story #42635462
What expert considers it a matter of time before 2048 is broken? 2048 is 112-bit-equivalent security.
RSA2048 is 112-bit-equivalent symmetric security under currently known methods. Number theory advances may change that. It is hard to imagine any significant advances in the breaking of symmetric cryptography (mathematically-unstructured permutations).

Cryptographically-relevant quantum computers (CRQC's) will also break smaller RSA keys long before (years?) the bigger ones. CRQC's can theoretically halve symmetric cryptography keys for brute force complexity (256-bit key becomes 128-bit for a CRQC cracker).

https://www.keylength.com/en/4/ NIST says 2048 bit RSA is good until 2030. I'm not sure what that means, perhaps that it will be broken considering advances, perhaps just that someone (read governments) who cares to spend 5 years on the problem will break your key.
loading story #42638185
loading story #42636110
loading story #42638492
Ed25519 has seen broad adoption in TLS and other stacks that are used pervasively where DKIM is also used. What’s blocking it for DKIM uniquely?

(This isn’t intended as a leading question.)

loading story #42634726
loading story #42634152
loading story #42634467
loading story #42633840
loading story #42633968
loading story #42637670
The key sizes we use today are expected to hold against a Dyson sphere focused on breaking them with the best exploit we know today.

What size do you suggest?

It's not quantum-safe though.
Larger keys won't make the algorithms quantum-safe either.
If I'm not mistaken, larger keys require more qbits in a machine to all be coherent together to be able to break it.

So it would be a slight increase in complexity, but if we are able to build a machine with enough qbits to crack 1024 keys, I don't think the engineering is all that far off from slightly scaling things up 2x-10x.

Which is why post-quantum algos were invented.
> Which is why post-quantum algos were invented.

Yup. And I don't even think quantum resistance was the goal of some of the algos that, yet, happen to be believed to be quantum resistant. Take "Lamport signatures" for example: that's from the late seventies. Did anyone even talk about quantum computers back then? I just checked and the word "quantum" doesn't even appear in Lamport's paper.

> Did anyone even talk about quantum computers back then?

Not unless they have a time machine. Shor's algorithm was discovered in the 90s (sure the concept of a quantum computer predates that, but i don't think anyone really realized they had applications to cryptography)

It's not quantum-broken though, it might just make it a bit faster. Just half a Dyson sphere.
loading story #42633980
loading story #42633885
loading story #42633919
Compare the time it takes to generate or decrypt/encrypt 4096 bit RSA versus 16384 bit RSA (it's not four times slower).
Indeed. There has got to be some middle ground there though that is both an incremental improvement and still within reason on cost
loading story #42633846
loading story #42636922
Key rotation tooling has never been given adequate attention since you only do it every few years. Something ends up breaking, even if it’s just the name of the key .

keys are stateful content like DB schemas, but they don’t receive daily attention, so the tooling to maintain them is usually ad-hoc scripts and manual steps.

loading story #42633847
loading story #42634327
loading story #42635264
loading story #42635909
loading story #42635022
loading story #42637713
loading story #42633769
loading story #42634442
loading story #42637778
loading story #42635209
loading story #42635120
loading story #42634075
loading story #42640078
loading story #42634162
loading story #42641042
loading story #42634172
loading story #42638859
loading story #42646946
loading story #42633807
loading story #42633694
loading story #42643002
loading story #42634284
loading story #42635807
loading story #42637329
loading story #42635858
loading story #42634810
loading story #42634065
loading story #42650365
loading story #42636520
loading story #42633991
loading story #42642540
loading story #42634010