Login
You're viewing the code4lib.social public feed.
  • Nov 25, 2026, 7:13 PM

    "Don't roll your own crypto" - an advice with a muddy purpose and a clear outcome:
    - people treating cryptography like an arcane magic and a scarce pool of experts
    - no pressure to make standards that are secure _and_ easy to implement

    💬 1🔄 4⭐ 3

Replies

  • 💬 0🔄 0⭐ 5
  • Nov 25, 2026, 7:42 PM

    @kirtai @jackdaniel

    I guess the point is that cryptography is both difficult and dangerous, but you two are making the excellent point that popular vendors are not obviously reliable at succeeding to do a better job than an expert's bespoke one.

    At the industrial scale, I suppose openbsd's funding exists because Theo is personally infinitely more reliable than any major trillion dollar company, or an industry consortium of rich companies.

    jd do you know context about sharplispers ironclad?

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 4
  • Nov 25, 2026, 8:07 PM

    @4censord @screwlisp @kirtai

    Many complex domains require experience that is gathered by "rolling your own", preferably by adhering to existing standard - and then fixing it.

    I think that emphasizing challenges like Crypto Pals and working on intelligible standards is the way to make rolling your own crypto more secure, and raising the bar of security universally.

    To rephrase: "if it is interesting to you, go ahead and roll your own - but mind these gotchas. If you are not interested, then here are off-the-shelf known solutions." -- less arrogant with better outcome.

    EDIT and there are of course use cases, where failures are critical. And that applies to cryptography and, say, databases -- you'd use known battle-proof crypto and database engines in these projects. But nobody says without any context "don't roll your own database".

    Edit2:
    1. make educational challenges like Crypto Pals
    2. work on intelligible standards
    3. work on adversarial test suites

    💬 0🔄 4⭐ 9
  • Nov 25, 2026, 8:15 PM

    @jackdaniel
    Actually, "don't roll your own database" is a common adage.

    I kind of take your point- like seeing people (possibly yourself) Do Fourier Transforms signifiantly wrong is a comparably big deal to doing crypto wrong, but crypto is treated as worse because people trust password protection.

    Viz openssl, while openbsd created openssl, its development was taken over by Industry, and then after heartbleed, openbsd created its own openssl implementation, libressl.

    @4censord @kirtai

    💬 1🔄 0⭐ 0
  • Nov 25, 2026, 8:17 PM

    @jackdaniel
    However the existence and licensing of libressl basically means big improvements from libressl get upstreamed into the openssl implementation it deprecated anyway, and then it appears to be very hard to even know what is happening in the crypto space.

    A failure example would be that wordpress shopping plugin's Troubles a few years ago.
    @4censord @kirtai

    💬 1🔄 0⭐ 0
  • Nov 25, 2026, 8:20 PM

    @jackdaniel
    In embeddable common lisp's case, if you had hundreds of people working for you, I suppose what we might want is for cryptography choice to be a compilation flag? Like openssl, libressl, home-rolled, .. . But I don't know how that relates to the design principles of ECL off the top of my head. Like choosing a garbage collector I suppose.
    @4censord @kirtai

    💬 1🔄 0⭐ 0
  • Nov 25, 2026, 8:22 PM

    @screwlisp @4censord @kirtai

    I'm not going to roll my own crypto, because I'm not interested in that. I'd be happy to use a good off-the-shelf FOSS solution. My point is about how flawed and self-defeating is the mentioned advice.

    If I were to include SSL support in ECL, I'd be looking for a secure library that can be linked both statically and dynamically, without additional dependencies (self-contained).

    💬 0🔄 0⭐ 2
  • Nov 25, 2026, 8:25 PM

    @screwlisp @4censord @kirtai

    Another thing, and I can't stress this enough, is that complicated standards make bootstrapping new ecosystems enormously complex.

    I.e you can write a very small web server and it will work great with not that much effort. If you add TLS to the mix, then you have a problem .

    💬 1🔄 0⭐ 2
  • 💬 0🔄 0⭐ 0
  • Nov 25, 2026, 8:20 PM

    @screwlisp @4censord @kirtai

    As noted earlier:
    - simpler standards
    - adversarial test suites
    - education

    That's the way for better crypto. Not "the holy church of security experts".

    And the context matters. "goto considered harmful" - esque advices without context are slogans.

    💬 1🔄 1⭐ 2
  • 💬 1🔄 0⭐ 0
  • Nov 26, 2026, 8:07 AM

    @jackdaniel A question I'd like to see explored is: How can we reduce the need for crypto? How else can we establish trust between parties communicating digitally?

    I guess banks will always need crypto, but they also have the means to hire crypto experts. But why does my blog need HTTPS? Could we have simpler tech to establish trust between my blog and its readers?

    @screwlisp @4censord

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 8:12 AM

    @khinsen @screwlisp @4censord

    The argument goes as follows: between you and the server there is ISP. What follows:

    1) If you can't ascertain that the message was not tampered with, then ISP can inject ads, or MITM can inject malware

    2) if you don't have your communication encrypted, then ISP (or MITM) can learn more about you - listen to your passwords, build a profile for your preferences etc

    And both points are valid in untrusted network (internet is very much that). IMO cryptography is not the problem. As noted in sibling messages, crypto should be easier to implement and easier to test against known attack vectors; relevant math is often not that hard (to implement); the problem comes from the dressing.

    Take as an example the Heartbleed attack - it was exploited by using a feature of the protocol that nobody uses in practice (heartbeat).

    EDIT so cryptography standards should limit their scope to:

    - signing messages
    - encrypting the channel

    and leave everything else to the application layer.

    What's more (and implicit from the above), the application layer should be fully oblivious about whether the encryption is used or not, it should be handled transparently on the OS level.

    Then applications don't take the responsibility for whether data is encrypted or not and it is on sysadmins.

    EDIT2 and of course, making it transparent to applications and depend on the OS can be screwed up royally :)

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 12:59 PM

    @jackdaniel That's the engineering answer, which presumes a certain level of abstraction (server/client, independently of content and user) and the quest for a universal solution.

    My blog requires less protection than a bank because the threat model is very different. No big entity cares about my blog. They would envisage MITM attacks or injecting malware only if my blog is one out of many sites they could attack at the same time.

    @screwlisp @4censord

    💬 3🔄 0⭐ 0
  • Nov 26, 2026, 1:03 PM

    @jackdaniel From that point of view, my blog should be based on something like Gemini, rather than the same tech stack that banks use. But unlike today's Gemini implementations, the blog tech stack should be interoperable with the bank tech stack. Linking back and forth in particular.

    @screwlisp @4censord

    💬 0🔄 0⭐ 0
  • Nov 26, 2026, 1:07 PM

    @khinsen @screwlisp @4censord

    I agree that there are different threat models for a bank and for a blog, where the former is far more critical.

    That said, the latter also has issues, most notably injecting ads and tracking users. They don't have to care explicitly about your blog if they can do that for "all unencrypted traffic".

    I think that the universal solution is better than maintaining separate compatibility bridges (your sibling post). You may have one standard (that ensures compatibility) and multiple implementations.

    But all that hangs on the requirement, that the standard must be reasonably easy to implement and reasonably easy to test against known malicious vectors.

    Alternative (interoperable stacks) kind of defeats the point, because now you have:

    [n implementations] - [1 standard]

    and then you'd have

    [n A implementations]
    -
    [n A-B bridges]
    -
    [n B implementations]

    _I don't think_ that this would be a good outcome.

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 2:32 PM

    @jackdaniel It's not an obvious trade-off for me. One aspect is efficiency vs. robustness through diversity. The first one is much easier to quantify than the second, so efficiency usually wins.

    Diversity is possible at the protocol level and at the implementation level, with different trade-offs. You seem to favor the implementation level. Fine with me!

    @screwlisp @4censord

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 3
  • Nov 26, 2026, 8:25 AM

    @kirtai I believe in rolling your own X no matter the circumstances, I believe in the critical thinking of people to weigh when and when not to on a case by case basis.

    Don't roll your own X people should be treated the same as don't read the Bible people of the dark ages. Doing things and failing is how we learn. If we adopt this culture of doing and failing, we will naturally evolve more systems to work with the fallibility of humans, and self propel the culture of more learning. This will create a bloom of handcrafted solutions for different use cases that better fit our problems, instead of one or two holy sacred incumbents.

    @screwlisp @jackdaniel @4censord

    💬 0🔄 1⭐ 0