Live data from Hacker News

Why are neural networks and cryptographic ciphers so similar? (2025)

reiner.org

21–30 of 55 posts

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#21
post #3

Can anyone recommend any good content to learn cryptography? Like, even if I read the algorithm for AES I have zero understanding about why it works this way I've finished the Cryptography I on Coursera already. Can't recommend it enough

[dead]

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#22
post #16
post #7

Earlier quoted context omitted.

Back in the day, I read Applied Cryptography (by Schneier) and clarity rained upon many things.

More damage has been done by that book than by any Herbert Schildt C language book.

This is news to me. Is it him in general or just that book?

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#23
post #16
post #7

Earlier quoted context omitted.

Back in the day, I read Applied Cryptography (by Schneier) and clarity rained upon many things.

More damage has been done by that book than by any Herbert Schildt C language book.

Can you elaborate?

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#25
post #22
post #16

Earlier quoted context omitted.

More damage has been done by that book than by any Herbert Schildt C language book.

This is news to me. Is it him in general or just that book?

Just that book. The followup (Practical Cryptography, now called Cryptography Engineering, though it's the same book) is much, much better --- though it's also totally out of date at this point, and would also get you in trouble.

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#26
I called this out to Thomas Pornin a few months ago (that the forward pass of a neural network and a block cipher rhymed in the sense of being an iterated complex linear function punctuated by a nonlinear function that keeps the whole system from collapsing into linearity) and he intimated that it was not the profound or useful observation that I thought it to be. I feel somewhat vindicated.

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#27
post #11

Earlier quoted context omitted.

I looked at the recommendations under your comment, but I don't think I'm capable of these either lol Any recommendations for a technically competent person, but for someone with math knowledge trailing off at Calc 2?

The math isn't that difficult once you grok mod math. It's like time, like doing addition and subtraction on a clock. What's 10 + 4 on a clock? 4 hours past 10 is 2.

The math stays difficult after basic discrete concepts and gets more difficult as you go. :)

It's straightforward to get yourself to a place where you can do cryptographic things and feel somewhat comfortable with what's happening. Truly understanding it to the point where you can reason safely about it is deceptively harder.

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#28
I think the underlying explanation is that both fields deal with very large state spaces, so the forms converge somewhat.

I think the contrast is more interesting: exact discrete trajectories in cryptography versus approximate continuous function approximation in neural networks.

In cryptography, you usually want a state space so large that nobody can accidentally find, reconstruct, or predict the same path you took.

In neural networks, you want an immense initial search space because NNs need to model the real world, which is highly complex and contains patterns that appear unpredictably. One aspect I think is often overlooked is that NNs are mostly deletive: they start with a very broad representational space and become progressively more specific by discarding what the NN perceives as irrelevant distinctions.

I think this puts the article's point about complexity and mixing in a clearer light. The same class of procedures achieves almost opposite effects. In neural networks, you want mixing so the model can approximate many possible paths at once. In cryptography, you want mixing so the path taken is unpredictable and hard to trace. The key difference is that, for NNs, an approximate path can be good enough. In cryptography, an approximate path is as useless as a very distant one.

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#29
post #14

I would argue that they are not the same, but there is a symmetry between them. The central problem of cryptology is to prevent inference about either the key or the plaintext, despite the requirement to be able to reconstruct the plaintext from the ciphertext+key. So ciphers have to almost perfectly mix information. Machine learning is possible because in the absence of perfect mixing, inference is possible (given m…

ChaCha20 got discovered using a computer search testing out resistance to certain attacks. Hence, the architecture came first and then the parameters came next. Any link with NN gradient descent? It would likely be an abstract one.

Re: Why are neural networks and cryptographic ciphers so similar? (2025)

#30

are they really? seems not accurate to me, the devil is in the details

Of course the devil is in details. This entire article read like an alien visiting Earth and concluding "Humans and Dogs have 84% DNA in common, no wonder they make such a good pair."
Post reply on HN