33 ms·
RSA is a fragile cryptosystem
- ChrisSD 7y agoIndeed. If you're not a cryptographer then you shouldn't be rolling your own crypto. That includes selecting low level libraries, etc. You want a whole crypto system that's made by experts. Preferably one that's open to auditing.
- ysavir 7y agoThis exactly. I wish the original article had this conclusion instead of trying to tell people how to "do it right", especially when the problem is people not understanding cryptography to a sufficient level in the first place.
- A2017U1 7y agoHow does one become a cryptographer then? Do the people who perpetuate this meme with no basis not realise the clear and present danger it presents to humanity? Yes certainly don't use homerolled crypto in production. More importantly do not dissuade human beings with talent to roll their own, play with others codebases, and in general have a good fucking time with cryptography. Straight out of the counter-intel handbook is how it looks when people repeat this bullshit ad nauseum. Everyone on Earth should roll their own crypto. Don't listen to this nonsense, the real world needs you.
- _jal 7y agoThe answer is the same as when this always comes up: mentally append "for realsies". The advice is meant to suggest that people not publish code or run services with incompetent crypto. Nobody is saying not to learn and play. They're saying don't set off a rocket while staring down the engine. The reason why it has to be said is that the consequences of doing so when writing crypto are not so impressively immediate or dramatic, but just as devastating to the outcome (and maybe cryptographer, depending on adversary). > Straight out of the CIA handbook is how you look when you repeat this bullshit ad nauseum. The CIA does not care if you play with libsodium.
- A2017U1 7y ago> The CIA does not care if you play with libsodium. Cryptographers are easy meat for lions. Care to place a long-standing bet on that? 20yrs or so? We can find a solid reasonable middleman here surely? They very much do care. I'm willing to bet on it becoming public knowledge within that timeframe. Keen?
- saagarjha 7y agoHow is the CIA going to stop you from downloading libsodium and doing whatever you want with it?
- A2017U1 7y agoThat was most certainly not the point made here. Go contribute to libsodium, go contribute to any reasonably well used crypto library, you've now got a big red dot on your back from an assortment of governments in perpetual conflict. I truly worry for anyone participating in these open source codebases and not being aware of how much they are targets. Take care of yourselves friends. Please.
- icebraining 7y ago> I truly worry for anyone participating in these open source codebases and not being aware of how much they are targets. So when you extorted people to play with other's crypto codebases in the previous post, were you trying to make them into targets?
- JetezLeLogin 7y agoExhorted, you probably meant!
- icebraining 7y agoYeah, thanks.
- dspillett 7y ago> > If you're not a cryptographer then you shouldn't be rolling your own crypto. > How does one become a cryptographer then? > Yes certainly don't use homerolled crypto in production. That is the point. When the glib phrase is repeated it is to people who are working on production, or something that might be in danger of one day soon being in production (we've all seen things go from proof of concept to production with insufficient reworking, it happens far too often). In that context it is correct to be constantly restated. If you are explicitly trying to understand cryptography, then hopefully you are aware of the higher level dangers while you are poking around the lower level details and until you are ready for prime-time you are able to keep your exploratory code from going anywhere near production, at least not without proper scrutiny. It is like the first two rules of optimisation: Rule 1: Don't. Rule 2 (for advanced programmers only): Don't yet.
- nraynaud 7y agoNo, either you want to become a cryptographer and you’ll need to learn, implement toy algorithm, toy with libraries, etc. But you’ll need some level of proficiency before putting anything to production. The real code contribution of cryptographers anyways tend to add some very specific details to libraries (like adding their latest invention). Now the general advice is that if you want to skip the 15 years it take to become a cryptographer and you want to send a message, there are ways.
- saagarjha 7y agoNobody is telling you that you can’t play around with crypto in your personal projects; you’re attacking a strawman. What they mean is this: > Yes certainly don't use homerolled crypto in production.
- opless 7y agoEven don't prototype with homerolled encryption. You should know how easy prototypes enter production!
- johncolanduoni 7y agoI think the track record of novel cryptography created by people inexperienced in the field indicates it’s something intelligence services would like people to do more of if possible. Are you sure you’re not working for the CIA?
- peterwwillis 7y ago> How does one become a cryptographer then? Get an advanced maths degree. Minor in cryptosystems. Spend a few years looking at old cryptosystems. Understand how they were designed, what their weaknesses were, and how new systems are designed. Read a lot of papers. Try to write your own system and ask peers to point out the glaringly obvious holes you didn't notice. > More importantly do not dissuade human beings with talent to roll their own, play with others codebases, and in general have a good fucking time with cryptography. The consequences of lots of people using shit crypto is that a lot of people become less secure, and won't have any idea about it. At the same time, us saying "don't roll your own" won't actually stop anyone who has a burning desire to play with crypto. So we're definitely going to keep dissuading people from rolling their own.
- A2017U1 7y agoWhile I want to commemd this comment, it all seems to have lit a bonfire of programmer-tier anger, so will still retaliate: People aren't using shit crypto, virtually no one is using anything other than what is highly vetted or otherwise google/apple/ms/etc is telling them to. What is the actual argument here? That some $randompeople play around with new cryptosystems and then share them with friends? The sheer derision that my original comment has directed at it is astounding, let the kids play with cryptography, who the fuck cares, I hope they roll all of the crypto themselves, the world will be a better place, who exactly is saying it should replace current elliptical curves decided so wholesomely for us all by NIST? The simple clear fact is that Western countries do not like and are actively campaigning against modern cryptography. Lets pretend we have some dignity left please as human beings. The West used to represent something, now it feels like we are taking notes from oppressive regimes and playing catch-up.
- peterwwillis 7y ago> People aren't using shit crypto From Why You Should Stop Using Telegram Right Now (2016) (https://gizmodo.com/why-you-should-stop-using-telegram-right-now-1782557415 https://gizmodo.com/why-you-should-stop-using-telegram-right...): According to interviews with leading encryption and security experts, Telegram has a wide range of security issues and doesn’t live up to its proclamations as a safe and secure messaging application. [...] Telegram did what’s known as “rolling their own encryption,” which is widely considered to be a fatal flaw when developing encrypted messaging apps.
- inlined 7y ago> Everyone on Earth should roll their own crypto. Don't listen to this nonsense, the real world needs you. This is an interesting exercise to help understand cryptography, but if you think cryptography is subtle or magical, you haven’t started looking at cryptanalysis. There are nearly countless possible side channel attacks. This is why we don’t roll our own practically speaking. It can take advanced degrees in mathematics to merely give ourselves some sense of assurance that our home rolled system is safe. A friend of mine did roll his own security. A decade ago he invented a new homomorphic encryption algorithm (type of encryption that allows meaningful operations on cypertext without revealing secrets). His first step? Getting advanced degrees in mathematics and at least a year of peer review to test against possible attacks. Only years later did he found a company on it. Unfortunately while the system was believed secure, a zero-trust system took too long and too much battery to generate keys on phones.
- sroussey 7y agoAny reference to their work?
- inlined 7y agohttps://www.google.com/amp/s/www.forbes.com/sites/thomasbrewster/2015/09/09/kryptnostic-homomorphic-encryption/amp/ https://www.google.com/amp/s/www.forbes.com/sites/thomasbrew...
- Ar-Curunir 7y agoIs there a link to the paper? As far as I'm aware, there is no practical FHE scheme in existence.
- A2017U1 7y agoI'm using the phrase in the sense of create or implement your own, play with it, not actually using it for critical applications. The world badly needs more cryptographers and their eyes on code whether from a purely academic background or digital tinkerer background. People should be encouraged everywhere to frolick in the ciphers.
- kokx 7y ago> How does one become a cryptographer then? Basically: studying it in depth (especially the mathematics part). Focus on cryptanalysis for a while, and find some flaws in existing implementations. The moment you really start to fix those flaws, you probably know enough to implement a cryptosystem in a reasonably safe manner. Even then, there likely will be many flaws in your implementation. So, you need other cryptographers to review it, several sets of eyes looking for flaws. Oh, and don't forget to make sure someone reviews for side channel attacks. (and some other things that I am probably forgetting right now) In the end, the cryptographers that implement cryptosystems are a rare breed. These generally include people that are good at both the hard mathematics involved and the low-level programming knowledge that it requires to prevent timing attacks and the like, and even some hardware knowledge. Who am I to say this? I have studied information security with some focus on crypto, including cryptanalysis and implementation of cryptosystems. Followed some MSc-level courses on implementation specifically, would not touch implementing a cryptosystem myself for production.
- A2017U1 7y agoQuality reply, thankyou. > So, you need other cryptographers to review it, several sets of eyes looking for flaws. That's a real problem with no easy solution, for every "new" cryptographer trying to implement a cryptosystem you need a dozen half-capable eyes on what they are doing. For anything used widely you need hundreds. Creating more half-capable eyes is a good thing.
- wglb 7y agoFirst, start with a site that will teach you some surprising things about crypto that you may have not thought possible: http://cryptopals.com/ http://cryptopals.com/. That is a good start.
- deleted 7y ago[deleted]
- rowanG077 7y agoSo what is it? Just stop using RSA completely or stop rolling your own RSA? The article sends mixed signals on this, I completely understand the latter as bad but I have used the RSA framework within .NET to sign messages before and I don't recall it being hard at all.
- floatboth 7y agoYes. Stop entirely. Developers in fact MUST NOT use ANY crypto primitives directly. "If you're typing the letters A-E-S into your code, you're doing it wrong." You WILL do something subtly (or not so subtly) wrong and it won't be secure. Use high-level constructs designed and peer-reviewed by cryptographers who know what they're doing. Basically: use libsodium.
- rowanG077 7y agoWith libsodium you still have to choose parameters though not that different from other crypto libraries(including .NET)
- floatboth 7y agocrypto_box_easy(ciphertext, MESSAGE, MESSAGE_LEN, nonce, bob_publickey, alice_secretkey) Where do you see a place for parameters? Even if there was some choice, it would've been a choice between known good options, no footguns.
- dchest 7y agoWhat parameters do you have to choose? Apart from nonce, which is confusing for most people who don't read documentation, and computational params for password hashing (unavoidable), there's no parameters to choose from (no curves, no hash functions, cipher modes, etc.)
- piokoch 7y agoI really would like to use libsodium, but I use Java. Looking at https://libsodium.gitbook.io/doc/bindings_for_other_languages https://libsodium.gitbook.io/doc/bindings_for_other_language... it seems that there are 5 different ports. The question which one is save to use? One implementation docs says: "I'm experiencing some issues on Windows. Do you have any idea? I'm sorry but I'm completely clueless about Windows environment, but if you have any suggestions or PR changes. They will be more than welcome." Can I trust them? How do I know there are no some Windows-specific issues in this implementation? Another library listed on this page does not have a single release? Could it be trusted? Next has been abandoned and moved into Apache Foundation incubator. Good but will it be maintained? Maybe use this, or maybe Lazysodium, which has a nice Github page? If I am to verify if any of those ports is a proper one probably I would have to really become a crypto expert. Isn't it safer to learn and understand how to use, say, AES algorithm as it is provided as a part of Java? There is a few important config choices, but still it looks easier than analyzing someone's libsodium port?
- AlEinstein 7y agoWell that title made me click on it and now I’ve bookmarked that page in case I ever feel the urge to implement my own crypto using RSA. Or at all for that matter.
- robmccoll 7y agoI think if you're interested in learning about the foundations and basic theory of asymmetric crypto systems, implementing your own RSA is a fun weekend project. Just never use that implementation or suddenly think "now I can write my own crypto for everything!" And also strongly consider using anything other than RSA for real work.
- buildzr 7y agoHonestly, I think your time would be better spent learning about different cryptographic primitives, - Hash functions - Key derivation functions - Public key cryptography - Block ciphers - Stream ciphers - CSPRNGs Understanding these primitives means you'll know what cryptographic news means, it means you'll understand how things like NaCl, TLS or the NOISE protocol are constructed under the hood, it means understanding how things like proof of work functions and cryptocurrencies work will be much easier. While I would never recommend constructing your own protocol based on these, having the understanding of how they work can give you a good idea of some of the nuances and risks associated with them and help you understand what it really means when they get broken.
- tptacek 7y agoNitpick: This includes some attacks that I don't think really ever occur in the real world (bad private exponent size, Franklin-Reiter) and misses one of the great RSA attacks, Bleichenbacher's "rump session" e=3 signature attack, about which there was an excellent NDSS paper (also being presented at Black Hat) just this year. So I guess I'm saying: RSA is even worse than this blog post suggests. https://www.ndss-symposium.org/wp-content/uploads/2019/02/ndss2019_04A-4_Chau_paper.pdf https://www.ndss-symposium.org/wp-content/uploads/2019/02/nd...
- philbarr 7y agoWhile the rule for devs is, "never roll your own crypto", what is the authoritative resource for what we should use?
- masklinn 7y ago> Trail of Bits recommends using Curve25519 for key exchange and digital signatures. Encryption needs to be done using a protocol called ECIES which combines an elliptic curve key exchange with a symmetric encryption algorithm. Curve25519 was designed to entirely prevent some of the things that can go wrong with other curves, and is very performant. Even better, it is implemented in libsodium, which has easy-to-read documentation and is available for most languages. (it's unclear from the text whether ECIES is implemented in libsodium or only Curve25519, the internet seems to believe nacl (/libsodium) implements its own superior variant of ECIES called crypto_box)
- lvh 7y agoECIES is part of a family of things that are all more or less just ElGamal with a symmetric primitive attached. libsodium implements one version of that with Curve25519 + secretbox (which in turn is XSalsa20.) It's really mostly just superior in the sense that it's a) fully specified, including test vectors b) all the knobs twiddled for safety, c) incidentally, very performant.
- 7y ago
- gnomewascool 7y agoTo anybody put off by the clickbaity title, as I initially was — the article is actually informative and well-written.
- rhacker 7y agoSame here, especially considering the 3 men are alive and may read the title it's a bit rude.
- OJFord 7y agoFully agreed, (alive or not!) and commented to the same effect before I saw yours. 'RSA is easy to get wrong, stop using it' would be better. More descriptive too. https://news.ycombinator.com/item?id=20382895 https://news.ycombinator.com/item?id=20382895
- mcnichol 7y agoThe video should definitely be watched. A little more revealing about the playfulness this team is addressing the issue, although still filling it in with their strong opinions and data. The article came across heavy handed which (I feel) distracted from some really good points.
- skrebbel 7y agoI'm a developer, not a cryptographer, and like most crypto articles, most of this post is gibberish to me. I really tried to follow it in the beginning, but then I gave up, scrolled to the "what should you use instead", and then realized I didn't understand that either. If this is article is "easy" crypto, and I shouldn't roll my own crypto, then what should I do? "Just use elliptic curve crypto but make sure you choose the right curve! Here's an abbreviation for you, libsodium has it so you're all set" doesn't comfort me much. I don't have a good intuition of what a curve even is and why my sensitive data can't just go straight ahead like all the other data. I mean, when I call into libsodium with parameters I do not understand, then aren't I, for all intents and purposes, rolling my own crypto anyway? How is any of this of help? If I want to allow my customers to send me encrypted data via an untrusted channel, then what do I do? I need public key crypto for that, right? Basically, I want the public key cryptography version of Coda Hale's classic blog post about password hashing [0], does that exist? EDIT: thanks for all the comments folks, great insights! I particularly found [1] by CiPHPerCoder to be a great starting point (akin to Coda's password article) for all kinds of scenarios. I feel much more confident about this stuff now than I did 2 hours ago. [0] https://codahale.com/how-to-safely-store-a-password/ https://codahale.com/how-to-safely-store-a-password/ [1] https://paragonie.com/blog/2017/06/libsodium-quick-reference-quick-comparison-similar-functions-and-which-one-use https://paragonie.com/blog/2017/06/libsodium-quick-reference...
- cesarb 7y agoThese two articles might help: https://paragonie.com/blog/2019/03/definitive-2019-guide-cryptographic-key-sizes-and-algorithm-recommendations https://paragonie.com/blog/2019/03/definitive-2019-guide-cry... https://latacora.micro.blog/2018/04/03/cryptographic-right-answers.html https://latacora.micro.blog/2018/04/03/cryptographic-right-a...
- lvh 7y agoDisclaimer: I co-authored the Latacora one. I think "key size" is something maybe protocol designers need to be worried about, but it's still about two hops above how kobs-set-for-safety I like recommendations I make to be for the median programmer.
- segfaultbuserr 7y agoCurve25519 and Curve448 should be strongly favored if you decided to start using ECC. Not unlike RSA, elliptic-curve cryptography has a lot of of edge cases, math pitfalls, and side-channel traps. * Your implementation produces incorrect results for some rare curve points. * Your implementation leaks secret data when the input isn't a curve point. * Your implementation leaks secret data through branch timing. * Your implementation leaks secret data through cache timing. Curve25519 and Curve448 are designed with secure implementation in mind, naturally, they trends to have more immunity to pitfalls. There is no invalid curve attack in Curve25519, every random integer is a valid public key, secret-dependent branching can be avoided easily, etc. https://safecurves.cr.yp.to/ https://safecurves.cr.yp.to/
- yarg 7y agoIt's not simply that they were designed to be secure - they utilised mathematically justifiable constants. See https://en.wikipedia.org/wiki/Nothing-up-my-sleeve_number https://en.wikipedia.org/wiki/Nothing-up-my-sleeve_number. There's actually a counter example on that Wiki page - the highly complex numbers used in the NIST curves, for which no path to derivation was publicly provided.
- segfaultbuserr 7y ago> There's actually a counter example on that Wiki page - the highly complex numbers used in the NIST curves, for which no path to derivation was publicly provided. It's both. The security of curves are evaluated according a set of criteria: 1. Whether the cost for attackers by the Rho Method is above 2^100? (security margin against known attack) - NIST P-Curves: Yes. - Curve25519/448: Yes. 2. Whether the curve has resistance against additive and multiplicative transfer to avoid potential attacks via index calculus? (security margin against known attack) - NIST P-Curves: Yes. - Curve25519/448: Yes. 3. Whether the absolute value of this complex-multiplication field discriminant D of the curve is larger than 2^100 to avoid attackers from benefiting from possible speedups to the Rho Method? (security margin against known attack) - NIST P-Curves: Yes. - Curve25519/448: Yes. Notably, - Bitcoin Curve (secp256k1): No. But it doesn't mean Bitcoin is broken, it just decreases our confidence that it would be still secure if HUGE speedups to the Rho Method are found for a practical attack. But finding it seems unlikely. 4. Whether the coefficients of the curve are justified mathematically? (security criteria against backdoor) - NIST P-Curves: No (!) - Curve25519/448: Yes. - Bitcoin Curve (secp256k1): Okay. For example, coefficients for NIST P-256 (secp256r1, prime256v1) is generated by hashing random seed: c49d3608 86e70493 6a6678e1 139d26b7 819f7e90 Nobody knows what is it. NIST has its own defense: this random seed is only used as the input of SHA-256, since all cryptographers know that SHA-256 is secure, nobody, not even the NSA, can invert SHA-256, the output must be secure. They called it "verifiable randomness". But it's still room of doubts for sophisticated cryptographers, e.g. See this highly-amusing, satirical paper with lots of insight on this issue: How to manipulate curve standards: a white paper for the black hat https://bada55.cr.yp.to/bada55-20150927.pdf https://bada55.cr.yp.to/bada55-20150927.pdf Coefficients for secp256k1 are not fully explained, but nothing fishy and generally looks good. And keep in mind that when Satoshi Nakamoto was developing Bitcoin, secp256k1 was the best choice among available, well-accepted standard curves from this perspective, obviously, Satoshi must be an experienced hacker and have made a careful decision. 5. Whether the construction of the curve allows "simple" multiplication and addition. (security criteria against implementation pitfalls). - NIST P-Curves: No. - Curve25519/448: Yes. - Bitcoin Curve (secp256k1): No. Curve25519 utilizes a mathematical technique called Montgomery Ladder, which also allowed the practical implementation of constant-time, side-channel resistance crypto. On the other hand, NIST curves make it difficult. 6. Whether the curve still offers strong security guarantee even if an attacker has "twisted" the curve, e.g. fooling a program to choose a point which is not on the actual curve. (security margin against known attack and implementation pitfalls) - NIST P-Curves: Yes. - Curve25519/448: Yes. - Bitcoin Curve (secp256k1): Yes. 7. Whether the representation of curve points are indistinguishable from uniform random strings. (security usefulness in various protocols) - NIST P-Curves: No. - Curve25519/448: Yes. - Bitcoin Curve (secp256k1): No. Therefore, we conclude Curve25519/448 is more robust than NIST curves.
- nailer 7y agoAs someone involved in the PKI ecosystem, the biggest thing stopping ECC from being adopted widely is: - AWS, which has incomplete ECC support https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html https://docs.aws.amazon.com/elasticloadbalancing/latest/appl... > ACM supports RSA certificates with a 4096 key length and EC certificates. However, you cannot install these certificates on your load balancer through integration with ACM. - Heroku, which is still RSA only https://devcenter.heroku.com/articles/keys https://devcenter.heroku.com/articles/keys Edit: not sure why the downmod so I've added references.
- lvh 7y agoFortunately many of the problems associated with RSA are less worrisome when they're used in a PKI context, where realistically the BRs (or at least CA praxis), together with the limited set of highly audited clients (browsers, mostly) prevents the worst from happening.
- nailer 7y agoThere's still the weak performance of RSA though, especially on mobile devices.
- Nursie 7y ago> TLS 1.3 no longer supports RSA This isn't entirely true, is it? AFAICT it no longer supports RSA as a key-exchange algorithm as earlier versions did, but it certainly supports RSA authentication. The only systems that used that for TLS I've known in the last 15(ish) years were government systems that specifically wanted to prevent PFS in their logged connections.
- lvh 7y agoAccording to the F5 telemetry report (and my own anecdotal evidence), non-PFS suites were a lot more popular than that, the majority as little as 5 years ago :-) [0]: https://www.f5.com/content/dam/f5/f5-labs/articles/20180423_tls_2017/2017_TLS_Telemetry_Report.pdf https://www.f5.com/content/dam/f5/f5-labs/articles/20180423_...
- tialaramex 7y agoDefinitely. There are loads of EDCO people in that data. (EDCO is Nalini Elkins' outfit, the Enterprise Data Centre Operators group - banks and that sort of thing, they tried pointlessly lobbying the TLS Working Group to get RSA Key Exchange back into TLS 1.3) I don't have very good contacts inside that industry any more (I now work for a startup) so I'll be interested to see what if anything they _actually_ do about this over the medium term. Trying to promote "alternatives" to TLS? Deploying DH where the "random" private values are actually from a fixed or pseudorandom source under their control? No idea yet. It is definitely true that some big name real world "security" companies will go out to a big corporation and tell them to mandate RSA key exchange in order to make the "security" product work because they want to do MITM. They're too cheap to do all the engineering to actually ship the session keys over the wire so they want you to just upload the RSA Private Key into their "security" product. I got this mandate to require RSA Key Ex (at my old job for a B2B app I wrote) and was like "That ain't going to work, this here is a mutually authenticated TLS session". And I ended up in a bunch of calls in which more and more senior people from the "security" product team were brought on until they eventually found someone who actually knew how it works to say that yes, of course you can't MITM a mutually authenticated session without assistance from both parties, so the product can't work.
- jshowa3 7y agoFrom what I read, the NSA has not recommended most crypto protocols due to quantum computing. However, they still recommend having a large key size as being one of the biggest factors in having strong crypto. So why not use RSA with larger keys? Granted, I'm not an expert either. Let me put a source against this so people don't state the obvious about large enough quantum computers not existing and such: http://blog.bettercrypto.com/?p=1917 http://blog.bettercrypto.com/?p=1917
- floatboth 7y agoBollocks, no one has a large enough quantum computer yet. What is known to exist is just small numbers of qubits, and they are extremely expensive to run. Key sizes are an attractive subject for bikeshedding. You can endlessly argue about whether better performance or stronger theoretical brute force resistance (e.g. billion years vs million years to crack) is more important. And yet, it is a silly thing to care about. Read the article, it does not even mention this topic really. It's all about implementation vulnerabilities, and how RSA is fundamentally resistant to correct implementation (requires padding, etc)
- chaosite 7y agoThat's basically irrelevant to the point the article is making. The article's basic gist is that RSA implemented perfectly is fine, but that actually getting to that perfect implementation is hard and there are an incredible number of gotchas. And because the basic idea behind it is simple, then devs tend to try their hand at DIYing it./
- lvh 7y agoYou would need an obscenely large key size to make RSA post-quantum secure. The speedup a quantum computer gives you isn't some linear factor. People have explored what that would look like: https://cr.yp.to/papers/pqrsa-20170419.pdf https://cr.yp.to/papers/pqrsa-20170419.pdf But more importantly: 1. No, quantum computers that big don't exist. 2. If they are somewhat practical, you really want perfect forward secrecy so they at least have to break a classically hard problem _every time_, which is unlikely with home-rolled RSA systems. 3. If you do care about post-quantum KEX (because your information needs to be secret for longer than you can count on quantum computers not being practical), we have faster alternatives, like SIDH.
- beefhash 7y ago> The common denominator in all of these parameter attacks is that the domain of possible parameter choices is much larger than that of secure parameter choices. Parameter selection isn't any easier in elliptic curve land. In fact, by the point that I believe you can make an educated choice in elliptic curves, you can also make a reasonable choice in RSA parameters. You have to: 1. Pick a curve. Which ones? You'll have to know. This article tells you to use Curve25519. Do you know if they're right? Not really. Is a Koblitz curve over GF(2m) a better choice? You sure can't tell. You'll have to rely on other people's guides, e.g. [1]. 2. Pick a library that supports the curve. This can be easy if you're on the beaten path, especially in C. This can be very hard on off-beat languages, which are generally stuck wrapping OpenSSL (and then typically have a weird interface to match as a cause of having to wrap C). 3. Interoperability concerns: Sometimes you don't actually control both halves of the software. You'll also have to pick something that plays nice with other things. And all of this is putting the cart before the horse. Programmers must first understand what kind of algorithm they need, only then they can make a choice of the actual cryptographic solutions, e.g. Crypto101[2]. I firmly believe that a basic working knowledge of cryptography is a hard requirement for a programmer that touches code going into production. If by some ungodly anti-miracle you're stuck implementing your curve yourself, you'd better be hiring external help. Ideally, however, you can use an existing, respected library. What is a "respected" library? Well, now we're back to “you'll have to know”. Expect to spend upwards of a dozen hours getting to grips with the basics. (Incidentally, public key cryptography has always been an implementation nightmare. ARX ciphers don't scare me as much and most hash functions seems fairly reasonable to implement, but public key cryptography is when the bignum math hell comes to bite you—and with elliptic curves, you also get “moon math”, as the article so aptly puts it, to go with it.) [1] https://news.ycombinator.com/item?id=20382244 https://news.ycombinator.com/item?id=20382244 [2] https://www.crypto101.io/ https://www.crypto101.io/
- masklinn 7y ago> Parameter selection isn't any easier in elliptic curve land. In fact, by the point that I believe you can make an educated choice in elliptic curves, you can also make a reasonable choice in RSA parameters. The differences, according to the article: 1. RSA looks easy, so developers are tempted to roll their own, not so with ECC 2. almost all RSA parameters are necessarily secret, making it harder to peek on supposedly well-designed systems and know what to select (or even how to select), ECC parameters are public and other users can be used as examples
- romaaeterna 7y agoTLDR: Cutting out all the fluff about developers screwing themselves when they try to roll their own solutions, his argument is that it's the necessity of padding that makes RSA fundamentally insecure, and we should use ECC instead. It's not a new viewpoint, and there are arguments for and against.
- someguydave 7y agoThe blog fails to explain why trailofbits are recommending ECC over RSA when the NSA is now recommending not using ECC and instead recommends RSA. https://eprint.iacr.org/2015/1018.pdf https://eprint.iacr.org/2015/1018.pdf
- jcranberry 7y agoThe article you linked is very specifically talking about quantum computing. The NSA seemed to be suggesting that practical quantum computers were coming so soon that people who had not yet upgraded from RSA to ECC should not bother to do so, and instead should save their money for the future upgrade to post-quantum protocols. Shortly thereafter, the NSA released a revised version in response to numerous queries and requests for clarification. The new wording was even more explicit in its negative tone on the continuing use of ECC: “...elliptic curve cryptography is not the long term solution many once hoped it would be. Thus, we have been obligated to update our strategy.” Although other parts of the statement assured the public that ECC was still recommended during the time before the advent of practical quantum computers, the overall impression was inescapable that the NSA was distancing itself from ECC.
- someguydave 7y agoThat's one of many possible interpretations.
- syn0byte 7y agoBecause the NSA recommends still using RSA over ECC? The NSA and NIST should, in a perfect world, have lost all credibility of any sort given the revelations of poisoned RNGs. It boggles my mind that they are still given any credence let alone still considered authoritative.
- lvh 7y agoFirstly, NSA recommended specific NIST-brand ECC that didn't have many of the practical security advantages of what's being recommended here. Secondly, if you were really that worried about quantum computing, you'd use a quantum-hard kex, like Google did with CECPQ1. (I can't speak to why the NSA doesn't tell you to do that. I'm sure it has people in it that think so.)
- mikorym 7y agoUnless I am stupid, these are all implementation specific problems (e.g.: bad key selection, bad key size selection, exploits due to coding errors, etc.) and this does not tell us anything new about prime number factorisation. If this assumption is correct, why not just recommend a key size and some checks for generation than recommending elliptic curves? Elliptic curves have their own problems especially due to their complications around exploits of specific curve properties but more importantly the fact that programmers won't understand what they are calling in their code. I understand that libsodium has been here now since 2005, but are we really at the point where we should stop using RSA just because a lot of Salesforce/Oracle/Azure/<insert boring job> developers are misusing RSA? I guess this question is really about whether we are at the anecdote stage or the herd immunity risk stage that OP mentions.
- gargravarr 7y agoMy takeaway from this article is that the problems are indeed implementation-specific, but that whilst the cryptographically-secure values represent a small subset of the possible values, it's still too large a selection to provide a generalised list of what values are suitable for purposes. They do admit that RSA can be implemented securely in theory, but that the range of possible implementations is so vast that it's incredibly difficult to know if the parameters chosen are vulnerable without a maths degree and some very deep analysis. On the other hand, those of us who write code that uses crypto are generally beaten about the head with 'NEVER ROLL YOUR OWN CRYPTO' and use library implementations right from the start. These are libraries that I assume are indeed written by people with maths degrees and have done careful analysis of the outputs. I know for a fact that I wouldn't trust any encryption I could write myself in an hour. The biggest obstacle I find with ECC is that it's relatively easy to judge security by RSA (assuming correct implementation) but it's surprisingly difficult to compare the two; if I want RSA-2048, what key size am I supposed to use. ECC was also heavily promoted as offering 'RSA-equivalent security' while using less CPU, which made it particularly suitable for mobile/embedded systems, without necessarily implying it was an improvement over RSA.
- loup-vaillant 7y ago
- deleted 7y ago[deleted]
- alltakendamned 7y agoFor any of you who want to develop a deeper understanding of what is mentioned in the blog post, I can recommend the book Serious Cryptography by Jean-Philippe Aumasson. It's one of the best and most accessible crypto books that have recently been written. https://nostarch.com/seriouscrypto https://nostarch.com/seriouscrypto
- jesseryoung 7y agoNote: I am not a cryptographer nor a security developer but I am fascinated by security and crypto. I was all onboard with this articles premise, that good crypto is hard to understand and RSA requires you to make choices about crypto that can easily you screw things up. Then I read the "So what should you use instead?" section: > "Developers could theoretically build an ECC implementation with terrible parameters and fail to check for things like invalid curve points, but they tend to not do this." Is this not exactly the authors complaint about RSA? Granted there's fewer places to screw up, but still, you're required to specify a parameter that most developers typically don't understand the ramifications of.
- lvh 7y agoThe article also tells you to use libsodium, which makes safe cryptographic choices. (It's absolutely true that ECC can be as much of a footgun, e.g. non-random-k ECDSA is worse than RSA PKCSv15. But the real takeaway is to use something that's already set for security, like libsodium.)
- cryptonector 7y agoWell, yes, but that's why we have ed25519 and such. ECDSA is a footgun.
- dmurdoch 7y agoFrom my understanding and maybe I'm wrong here, he means that they tend to not roll their own ECC implementations. From the video, one of his major complaints is that people learn RSA in their first year of university, understand the math, then roll their own. How hard can it be, its modulo and exponents. People don't tend to do this with ECC. They just pick a library. You are right in saying that the same roll your own problems that occur with RSA would occur with ECC.
- djsumdog 7y agoThis article doesn't mention openssl or ssh-keygen. Are the standard commands we see in most articles for creating keys via these two popular tools compromised in any way? I never roll my own encryption, and most developers don't (unless they're just playing with stuff and learning how to understand it; and not use it in production). I stick to standard tools and libraries like Legion of the Bouncy Castle and pypi RSA. I wish this article covered the way most developers interact with RSA libraries and showing us those specific problems.
- SamuelAdams 7y ago> When e = 3, or a similarly small number, many things can go wrong. Low public exponents often combine with other common mistakes to either allow an attacker to decrypt specific ciphertexts or factor N. For instance, the Franklin-Reiter attack allows a malicious party to decrypt two messages that are related by a known, fixed distance. Surely anyone who studied a single textbook about crypto knows this? Or anyone who bothered to do a bit of reading about the crypto library they are using? After a bit of searching, apparently this is a big issue. Search for "RSA.gen_key" on any of the following pages: Exhibit A:https://github.com/const586/freestream/blob/ee95c78e85719caad9f2f421b60a100aa463a0a1/freestream/Core/LiveSourceAuthConfig.py https://github.com/const586/freestream/blob/ee95c78e85719caa... Exhibit B:https://github.com/lixmgl/Intern_OpenStack_Swift/blob/40c241319c6b9a7aabacc9d927486864d13b8055/trunk/salt/salt/crypt.py https://github.com/lixmgl/Intern_OpenStack_Swift/blob/40c241... Exhibit C:https://github.com/egbertbouman/tribler-g/blob/14e5c4eaf66f50d5ea54aa8f30ddc8a4a2017504/Tribler/Core/LiveSourceAuthConfig.py https://github.com/egbertbouman/tribler-g/blob/14e5c4eaf66f5... Exhibit D:https://github.com/wizzard/dm-p2player/blob/fb3a89aedc0a23741875c454468db9c2fb84e147/Tribler/Core/LiveSourceAuthConfig.py https://github.com/wizzard/dm-p2player/blob/fb3a89aedc0a2374... Exhibit E:https://github.com/mimianddaniel/booksalt/blob/248c2349fd9a6edc30d48d11673ab72bed4583ce/salt/crypt.py https://github.com/mimianddaniel/booksalt/blob/248c2349fd9a6... Exhibit F:https://github.com/GrandPaRPi/p2ptv-pi/blob/6f79c00f9055a3763ddfe1dc41e14d2cb533f4c3/acestream/ACEStream/Core/LiveSourceAuthConfig.py https://github.com/GrandPaRPi/p2ptv-pi/blob/6f79c00f9055a376... Exhibit G:https://github.com/C6SUMMER/allinclusive-kodi-pi/blob/8baf247c79526849c640c6e56ca57a708a65bd11/.kodi/userdata/addon_data/plugin.video.p2p-streams/acestream/ace/ACEStream/Core/LiveSourceAuthConfig.py https://github.com/C6SUMMER/allinclusive-kodi-pi/blob/8baf24...
- djsumdog 7y agoUgh, and they're all using M2Crypto, which is terrible and broken anyway. I had huge issues with encrypting things with it and being able to decrypt or verify signatures with other libraries. I switched to PyPi RSA. It took a little bit of digging, but it seems to use a sane exponent by default: https://github.com/sybrenstuvel/python-rsa/blob/11bf33264c620684fcae6c248df30c0a444babdf/rsa/key.py#L48 https://github.com/sybrenstuvel/python-rsa/blob/11bf33264c62...
- groovybits 7y agoI generally enjoy the content that Trail of Bits puts out, but the harsh tone and use of explatives seems only for the sake of attention to a non-issue. RSA, the algorithm, is generally safe for real-world use. It is possible to use RSA securely (we've been doing it). However, there is indeed an issue. Lets define the issue: Poor understanding of cryptography leads to poor implementation in practice. This issue applies to any crypto algorthim, not just RSA and ECC. If everyone dropped RSA tomorrow in favor of ECC, would all of our problems be solved? No. How to solve this issue? 1. Increase understanding of general cryptography. It is a dense subject. 2. Make implementation of cryptography easier. This is slightly more difficult though, as it depends on your use-case.
- reaperhulk 7y agoThe specific tone of this post is purposefully bombastic to call attention to the fact that RSA is uniquely difficult to implement and utilize correctly. Newer cryptographic constructs use various methods to reduce the probability of incorrect implementation and improve misuse resistance. Are they perfect? Of course not! But we're improving all the time with signature algorithms like ed25519, NMR constructions like SIV, etc.
- intuitionist 7y agoI don’t think the problem is that RSA is harder to implement correctly than, say, Curve25519. The problem is that it’s much easier to implement almost correctly.
- CiPHPerCoder 7y ago> 2. Make implementation of cryptography easier. This is slightly more difficult though, as it depends on your use-case. No, this is actually much easier than increasing general understanding. Just get the experts (which is a much smaller pool of individuals than the general populace) to commit to designing things like WireGuard instead of OpenVPN, sodium instead of OpenSSL, PASETO instead of JWT, etc.
- jvanderbot 7y agoSo, is ssh-keygen security theater?
- castis 7y agonot if you use a different type, something like -t ecdsa
- jvanderbot 7y agoFollowing my eldritch training in the dark arts: I googled then found a stackexchange answer on this topic [1] 1. https://security.stackexchange.com/questions/143442/what-are-ssh-keygen-best-practices#144044 https://security.stackexchange.com/questions/143442/what-are...)
- xaduha 7y ago> More concretely, that means if the person sitting next to me at work uses a smartcard granting them access to private documents, and they leave it on their desk during lunch, I can clone the smartcard and give myself access to all their sensitive files. I'm very skeptical that this is actually possible with proper Javacards. In any case you shouldn't leave your smartcard lying around. And furthermore what kind of system uses RSA for document/disk encryption?
- LIV2 7y agoIndeed the whole point of smartcards are that they're portable HSM's, you can't simply clone a smartcard. You'd even need the pincode if you stole one and would have to use it before it was noticed/revoked. Presumably there are some organisations that use smart cards for EFS encryption in windows but not sure if BitLocker supports it
- xaduha 7y agoBitlocker supports smartcards just fine (gotta set SelfSignedCertificates and CertificateOID though). I don't know much about encryption as a whole, but I have some inkling about smartcards and this makes me suspect this whole article as FUD.
- jupp0r 7y agoThe article makes good points against rolling your own crypto. Is there anything in there that can’t be solved by implementing it properly in a library? Openssl works fine with RSA+TLS. Isn’t the lesson learned from this that we need higher abstraction level (foolproof) APIs for our crypto libraries rather than not use RSA?
- dagenix 7y agoIt's still slow and the keys are large. RSA isn't supported by TLS 1.3, so I think a blanket statement that it works with TLS is missing a major caveat.
- brohee 7y agoSetting up the session key using RSA encryption isn't supported in TLS1.3. Authenticating with RSA signature sure is, and is the most common case...
- dagenix 7y agoFair enough, I was wrong there - RSA is still used for some things in TLS 1.3. However, I stand by my point that there are downsides to RSA and that its misleading to say "RSA + TLS is fine" when TLS 1.3 actively reduced its use of RSA.
- obtino 7y agoKind of off-topic, but why doesn't their site https://trailofbits.com/ https://trailofbits.com/ have their certificate configured correctly? I know that their main site is https://www.trailofbits.com https://www.trailofbits.com but I didn't expect their other record to be configured incorrectly.
- raxxorrax 7y ago> developers often choose e = 3 Never seen this in all my failed life. It is basically 65537 everywhere I have seen RSA used. That actually led me to Fermat numbers and why they are used because it looked like a conspiracy to me. I also never generated p,q or d manually and just trust some tools from some crypt-weirdos. So it is 1 parameter I have to remember, right? I am only a user of RSA and would never implement it myself. But prominent web services mostly supply RSA parameters for their encrypted content. Some have shifted to ed25519, but it is still very rare in my experience.
- commandlinefan 7y ago> it looked like a conspiracy to me Not a conspiracy ; ). It has to do with the exponentiation. Most fast math libraries exponentiate quickly by squaring and multiplying: if you want to compute, say, x^23, you can either multiply x by itself 23 times, or you can compute: ((((x^2)^2)x)^2)x^2)x: four squaring operations and four multiplications for a savings of 15 operations. You can do this factoring easily based on the binary representation of the exponent - in this case, 23 is 10111. So I’m going to square x 5 times (since the bit length of the representation is 5 bits long) and additionally multiply x by the result every time I encounter a one bit. Now, if I want to speed this up, it’s in my best interest to choose an exponent with the fewest one bits possible - preferably with a one at the beginning and a one at the end, so now I only have to square _n_ times and multiply twice. As it turns out, numbers whose binary representation have a one at the beginning and a one at the end turn out to be Fermat primes: 2^n+1.
- OJFord 7y agoGiven that 'RSA' is derived from real people's initials, the title seems even more unnecessarily unsavoury than it anyway is. Can we change it at least here? 'RSA is easy to get wrong; stop using it' seems harmless, and better describes the content anyway.
- brianpgordon 7y agoIt's also the name of a company, and after the Dual_EC_DRBG scandal they deserve every bit of any venom directed at them.
- TravHatesMe 7y agoI agree with you. Putting expletives in titles is immature. Reminds me of teenage years, when people overused swear words and thought they were so cool and edgy. "fuck this" and "fuck that" just sounds childish when speaking about something technical or academic.
- arendtio 7y agoActually, I found the old title ('Fuck RSA') expressed an extreme emotion. The new title doesn't transport any emotions ('RSA is a fragile cryptosystem'). Given that the point of the article is that something has to change, I wonder if that old title wasn't the more appropriate and expressive one. But hey, who cares...
- TravHatesMe 7y agoI see your point but I think it is a matter of professionalism. If you're going to critique something technical and you want to be taken seriously then it is best to remove (or reduce) emotion from the equation. In my opinion introducing swearing/emotion to an argument weakens it, regardless of its validity.
- commandlinefan 7y agoAnd the NSA is recommending that we not use ECC anymore, either: https://threatpost.com/nsas-divorce-from-ecc-causing-crypto-hand-wringing/115150/ https://threatpost.com/nsas-divorce-from-ecc-causing-crypto-...
- snarf21 7y agoThere are some weak curves that may be vulnerable. This is mostly (conjectured) to be about quantum computing. However, the solution they offer is RSA 3072. No thanks, I'll stick with ECC. We'll know pretty instantly when ECC gets cracked as the whole crypto space will collapse like a balloon. You could also be more cynical and assume that the NSA has a backdoor for even huge RSA and just want to push people to something they pwn.
- monkeynotes 7y agoGiven what we know about the NSA, do you have to be 'cynical'? I think a backdoor is even likely.
- commandlinefan 7y agoKoblitz and Menenez took a long look at that - they believe it's possible, but not necessarily likely: https://eprint.iacr.org/2015/1018.pdf https://eprint.iacr.org/2015/1018.pdf
- monkeynotes 7y agoGiven the known motivations of the NSA, and the deep involvement they had in designing and promoting SHA and its derivatives gives reasonable doubt to their benevolent credibility. Look at the amount of trouble the NSA went into to create Stuxnet. They stole digitally signed certificates from big corporations, completely undetected. If a known burglar installed your home security system, even if the security system was from a well known and trusted manufacturer would you trust that your house was actually secure while you were on vacation?
- e40 7y agoWhat does this mean for ssh key generation?
- kpcyrd 7y agossh-keygen -t ed25519
- FraKtus 7y agoThe article conclusion is that picking the wrong parameters (prime numbers, e) leads to being vulnerable to many attacks. Are there tools that will assist in choosing or testing those parameters?
- tinus_hn 7y agoR, S and A are real people (Rivest, Shamir and Adleman) and I don’t think it is appropriate to say fuck them, even if the system they designed 40 years ago doesn’t hold up to today’s standards.
- lou1306 7y agoThe title is clearly directed at the cryptosystem, not its authors.
- cwyers 7y agoI mean, the article includes a YouTube video of a presentation where the screengrab is a picture of Ron Rivest with his eyes glowing red, I'm not quite as sure as you that's clear.
- gnulinux 7y agoI'm not following, it's very clearly humorous. Red glowing eyes is a very popular internet meme. E.g. recently people use that for Game of Thrones memes, or political memes, or for animals etc (like that glowing eye seagull meme).
- dymk 7y agoRegardless, there's more effective ways to express criticism other than "fuck <X>"
- meesles 7y agoYeah, agreed. At the least RSA is a significant milestone in computing security and those that contributed deserve some respect. Meritocracy, a young workforce, and aging technology can be a very unpleasant cocktail.
- gjvc 7y agoYes. See also https://news.ycombinator.com/item?id=4956430 https://news.ycombinator.com/item?id=4956430
- monkeynotes 7y agoTIL that the NSA designed SHA and there is at least a chance they implementation of the elliptic curve has a back-door[1] [1] https://arstechnica.com/information-technology/2014/01/how-the-nsa-may-have-put-a-backdoor-in-rsas-cryptography-a-technical-primer/ https://arstechnica.com/information-technology/2014/01/how-t...
- AaronFriel 7y agoThe NIST and NSA didn't have a hand in deriving Curve 25519, which was created by a very well trusted cryptographer Daniel J. Bernstein. One of the goals of Curve 25519, IIRC, was to use parameters chosen from a handful of mathematical constants as seeds, as opposed to black box constants which could be chosen by an attacker with advanced cryptographic knowledge. (e.g.: the largest employer of mathematicians in the country, the NSA.)
- cryptonector 7y agoYou're probably thinking of Dual_EC DRBG, not SHA. And perhaps some of the NIST curves. It's hard to imagine how to backdoor something like SHA-1, and no one thinks it has been, as it's just a hash function -- that's not where the money's at. Dual_EC DRBG was never really that much in open source or commercial software, though I wouldn't be surprised if it got used by some choice targets of NSA espionage. (Dual_EC is best thought of as a key escrow scheme, which is fine if you want to use it in your org, with your own curve. The problem with Dual_EC is that the public wasn't told this -- the NSA pulled a fast one on NIST.) As to curves, just use Curve25519 and Curve448 -- those are "nothing up my sleeve" curves where the authors came up with a set of rules for picking a curve's parameters, then picked the one that most closely matched the stated goals according to their rules. The way they are it's very difficult to imagine that the authors somehow found a curve with a backdoor and then retroactively designed rules to generate the same curve, rules that have to be simple and obvious (at least to cryptographers anyways). There are many benefits to those curves, not the least of which is that their public keys are smaller than RSA or modular DH keys, and that they are faster, all while being more secure.
- Hitton 7y agoWell the article is certainly informative why not to self-implement RSA, but the conclusion to just use libsodium seems stupid. I don't really know cryptography, but I'm sure there are libraries that implement RSA correctly and could be easily used instead.
- dagenix 7y ago> I don't really know cryptography, but I'm sure there are libraries that implement RSA correctly and could be easily used instead. In one sentence you admit you have limited knowledge of the field and then immediately make a definitive statement about the field. Bold.
- tabletopneedle 7y agoEven if you were using a perfect implementation of RSA-OAEP, it would still be less secure than Diffie-Hellman over Curve25519 (called X25519) or Curve448 (called X448). This is because RSA lacks forward secrecy: If the private RSA key is stolen, it can be used to retrospectively decrypt all past communication. Also X448 provides the equivalent security of ~15000-bit RSA with a fraction of the key size, and key generation takes milliseconds instead of minutes. tl;dr For key exchange, use X25519 or X448. For digital signatures, use Curve25519-based ed25519 signatures. For authenticating communication, use authenticating encryption like ChaCha20-Poly1305 or Salsa20-Poly1305 or AES256-GCM. For hash function, use Blake2 or SHA3-256 or SHA256.
- Modulusmath 7y agoYou can only decrypt the past sessions if you also captured the initial handshake of the TCP connection.
- Hitton 7y agoAs I said, I don't really know much about, but this is bullshit. RSA lacks perfect forward secrecy is same as saying that ECDH lacks perfect forward secrecy. Both is true, and both can be used with ephemeral keys, which provide forward secrecy to both (and therefore must use other way to authenticate). Claiming that it's somehow RSA's problem while willfully pretending that it doesn't concern elliptic curve cryptography is very dishonest.
- dmitryminkovsky 7y ago> Developers have even used e = 1, which doesn’t actually encrypt the plaintext Ouch
- miguelmota 7y agoWhat's the TLDR for a non cryptographer that simply wants to encrypt messages for sending? The post was over my head
- lvh 7y agoWe did a blog post! You might like it. https://latacora.micro.blog/2018/04/03/cryptographic-right-answers.html https://latacora.micro.blog/2018/04/03/cryptographic-right-a...
- deathanatos 7y agoBecause it's supported, not yet broken, and not from a government agency whose loyalty to its people is questionable. The EC curves from NIST[1]: > cryptography experts have also expressed concern over the security of the NIST recommended elliptic curves C.f. [this comment and the thread of comments nearby][2], where this, and some other concerns, are discussed. But the concerns about hidden numbers from a government agency in a world where we know what we know from Snowden just kills the NIST curves for me. I'd happily use Curve25519/Ed25519 over RSA, if it is supported, but that's the trick. AFAIK, TLS 1.3 supports it, but the CA/B forum does not, meaning CAs won't issue such certificates, since they're bound by those rules. ACME, AFIAK, also does not support Ed25519 yet, though I believe there are plans in motion to do so. SSH is about the happiest story: it's well supported by OpenSSH. Aside from that, as a dev, I try to let well-known TLS libraries handle the encryption for me, as much as possible. (But even that is hard; many tools/libraries make it incredibly easy to generate invalid certs, short keys, fail to correctly validate a supplied certificate, etc.) Or push it over SSH. [1]: https://en.wikipedia.org/wiki/Elliptic-curve_cryptography https://en.wikipedia.org/wiki/Elliptic-curve_cryptography [2]: https://news.ycombinator.com/item?id=20382720 https://news.ycombinator.com/item?id=20382720
- Taniwha 7y agoIn New Zealand the RSA is the equivalent of the VFW, they spent most of my teenage years trying to get people my age drafted and sent to fight in Vietnam, apparently it would have made us men - so yeah fuck 'em
- baby 7y agoFrom my point of view, RSA has been damaged by too many bad implementations and standards, eventhough it is a legitimate cryptographic algorithm. I even co-authored a paper[1] with Shamir himself that ended on recommending not to use RSA in 2019. I'm currently writing a book targetted to developers[2] and I'm wondering how much I should write about RSA. There are two cryptographic primitives (types of algorithm) exposed by RSA: * Encryption * Signature The signature algorithm has two adopted standards usually named RSA PKCS#1v1.5 and RSA-PSS. The latter one is more recent and provides a proof of security but everyone still use the former. The former hasn't been broken and is still pretty solid. Most internet certificates are signed using RSA PKCS#1v1.5 I believe. The encryption algorithm is the problem (also used to perform key exchanges). It also has two adopted standards usually called RSA PKCS#1v1.5 (same name as the signature scheme I know...) and OAEP. OAEP is more recent and quite secure, but nobody seems to use it. Instead the former is still largely used in applications, and is often the default algorithm you use when you write RSA in many cryptographic libraries. Unfortunately it has been broken by Bleichenbacher in 1998 and it is practical to attack it. There's been many attempts to "fix" it and they have been repeatidly broken as well. So don't expect the library you use to implement it correctly. [1]: https://eprint.iacr.org/2018/1173 https://eprint.iacr.org/2018/1173 [2]: https://www.manning.com/books/real-world-cryptography https://www.manning.com/books/real-world-cryptography
- xucheng 7y ago> The former hasn't been broken and is still pretty solid. Most internet certificates are signed using RSA PKCS#1v1.5 I believe. FYI, RSA PKCS#1v1.5 signatures can be broken due to trivial implementation errors. [1] [1]: https://www.cs.purdue.edu/homes/schau/files/pkcs1v1_5-ndss19.pdf https://www.cs.purdue.edu/homes/schau/files/pkcs1v1_5-ndss19...
- baby 7y agoThanks! I hadn't seen that paper :) From a cursory glance, all of these implementations are in C it seems like a C systemic issue, not an issue with RSA. But I might be wrong because I've yet to read the paper.
- xrd 7y agoOn a related note: I was recently reviewing the web crypto API and I was surprised to see that only RSA works for encrypting/decrypting data. They do offer support for ECDSA to sign and verify messages, but not encrypt data using public keys with elliptic curves. Is there a reason for this? For example: encryption: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt#Parameters https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypt... Note that ECDSA is missing. But, for signing: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/sign#Parameters https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypt... Here, ECDSA is an option. Why the difference? It means you cannot use your web browser crypto to interact with the majority of blockchains (like Ethereum). Is there a good reason why support inside your browser for signing is available with ECDSA but not encryption? Is this a patent or IP issue, or perhaps a political issue. I always thought one reason for not using RSA was that you never know if there are backdoors the US government has installed, but this article makes it sound technically poor as well.
- tptacek 7y agoYou don't normally encrypt with ECC. You use it to establish a symmetric key, and encrypt with that. Look for WebCrypto examples for ECDH. In fact, the ability to encrypt directly with RSA is probably a bug, not a feature. There are too many ways to do it catastrophically wrong, and it almost guarantees cryptosystems without forward secrecy. (WebCrypto isn't great and I'd avoid it, but this isn't why).
- xrd 7y agoThanks, this is very clarifying. Do you have a link to a discussion on why WebCrypto isn't great? More specifically, are you saying there is no real good way to do encryption with WebCrypto, or is it that it is too easy to do it wrong?
- tptacek 7y agoIt doesn't address the core problem with browser encryption, which is that trust is inevitably rooted in the servers that deliver your content; WebCrypto bakes more of the "guts" of crypto primitives into the browser, where they don't have to be remotely programmed through Javascript, but the "joinery" is still content-controlled Javascript and is more than flexible enough to allow a malicious server to (very) surreptitiously exfiltrate secrets. It can make some sense in extensions, or in situations where client-side cryptography is more an interoperability or offloading concern than an end-to-end security concern. But ultimately, it's misused more than it's used well.
- m90 7y agoThings like this make me phrase the following question (which I never see answered): if crypto is so incredibly hard - N.B.: I do think it actually is very hard myself - what is a run-off-the-mill developer to do? Shouldn't I even try to build a secure application using what is out there, even if it has possible attack vectors? If I get it 98% right, isn't this a win for users already?
- jason0597 7y agoIt seems to me that this blog post is mostly about parameter choosing and this criticism could just as easily be applied to AES (there are lots of pitfalls there too), or really to any cryptography algorithm.
- rocqua 7y ago> this criticism could just as easily be applied to AES Not really, because the pitfalls in AES are more well-known. Moreover, there are widespread AES-modes that work pretty well. Really, once you have picked a mode of AES (besides ECB) the biggest pitfalls are 'only use a nonce once' and 'use HMAC (MAC-then-encrypt) if your mode isn't authenticated'. With AES-GCM, that last one drops off. With AES-SIV the first requirement drops, and AES-GCM-SIV has neither consideration. Granted, AES-GCM and similar are not trivial to implement, but given there are test-vectors it is harder to accidentally publish a faulty version. Moreover, much fewer people actually know how AES works. Especially compared with the amount of people who could essentially implement primitive (insecure) RSA from memory. This comes with many more attempts at RSA. Essentially because the distance between the insecure primitive and the secure systems using RSA is so incredibly large.
- tptacek 7y agoThere definitely are similar pitfalls in AES, and nobody should be encrypting with "AES"; they should be using something like AES-GCM-SIV (or, to extend the analogy with the post, Chapoly, which has the virtue of only being usable in a relatively secure fashion). More cryptography has been broken by casual invocation of AES than has been broken by serious attempts to deploy custom ciphers.
- korethr 7y agoI would love to eliminate RSA from the environments I am responsible for, and replace it with something using Curve25519. However, one place I see RSA still in use is in TLS certificates. Using Curve25519 in TLSv1.3 is great, but the use of RSA-signed certs in the beginning of setting up that TLS connection still strikes me as a weak link. AFAICT, CA vendors don't offer cert signing in anything other than RSA at present. Is there any motion to getting Curve25519 replacing RSA in the CA cert system for TLS or code signing, or are we gonna be stuck with RSA for certs for the next decade?
- deleted 7y ago[deleted]
- dwheeler 7y agoThe CII best practices badge ( https://bestpractices.coreinfrastructure.org https://bestpractices.coreinfrastructure.org ), which identifies key best practices for OSS projects, doesn't forbid the use of the RSA algorithm. In many situations forbidding the use of RSA (when using a public key cryptosystem) is completely impractical today. RSA is really popular, and a lot of OSS projects must be compatible with systems and organizations that use RSA. Besides, it appears to me that the primary problem is people who roll their own RSA implementations. As the article says, "In circumstances where people implement their own RSA, all bets are off in terms of using standard RSA setup procedures, and developers will frequently do strange things...". It also later shows a picture where the disastrous choice is "rolling your own RSA". Yes, there are a lot of ways to screw up an RSA implementation (as noted in the article), but that's less important if it's implemented by people who know what they're doing. The CII badge does specifically address the problem of people who roll their own crypto. Specifically, its "crypto_call" criterion says: "If the software produced by the project is an application or library, and its primary purpose is not to implement cryptography, then it SHOULD only call on software specifically designed to implement cryptographic functions; it SHOULD NOT re-implement its own." https://github.com/coreinfrastructure/best-practices-badge/blob/master/doc/criteria.md#crypto_call https://github.com/coreinfrastructure/best-practices-badge/b... Full disclosure: I lead the CII Best Practices badge project.
- loup-vaillant 7y ago> it appears to me that the primary problem is people who roll their own RSA implementations And why do you think they do? The article has an explanation for this: RSA looks easy enough to implement. If you tell people to use RSA, many will roll their own, even if they don't know what they're doing. And to be honest, after having read this article, I don't trust even the properly peer reviewed implementations of RSA. And if compatibility is an issue, I'll first try to convince whoever I must convince to switch to Curve25519, which is simpler to implement, more secure, and faster in most cases. (Of course, one should still use an existing implementation.)
- dwheeler 7y agoThere are many advantages to Curve25519, but in many cases you need to use RSA. E.g., when you're trying to talk to arbitrary websites securely, you don't get to choose what was used to sign their certificate. There are many circumstances where you have to build systems that work with other systems, and ignoring that doesn't make it go away. I think the key advice is to use an existing crypto library. A non-expert who tries to implement ECC themselves will almost certainly screw it up as well. Sure, it is a little less likely, but it is still possible.
- oscar567 7y agopeople say binary options brokers are scam, i can boldly say that's not true because i have been doing a lot of trading not only that, i have been doing a lot of winnings sometime ago a friend refereed me to One Mr Dylan for assistance with his help and his masterclass strategy I'm able to make $3500 weekly and a successful withdraw and also recovered all my lost funds, you can contact him for assistance on Dylanryhan2@gmail.com