# Can crypto.SE help with implementing a secure protocol?

Having lurked here for a while, I have a problem understanding how crypto.SE can help someone in the real world, other than academically. I've learnt a lot about aspects of cryptography and some of the ad hoc rules that seem to operate on this forum. But I don't see how what I've learnt can be put to non trivial practical use.

Perhaps my issue is best illustrated with an example. Humpty Dumpty wants to securely talk to Pablo across the open internet, but doesn't want Candy to be able to listen in. Pablo also wants to know that the messages he's receiving do indeed come from Humpty Dumpy, and that Candy hasn't interfered with them. So I'm looking for some encryption and some authentication. Herein lies the problem.

1. Rule 1 is than I mustn't implement my own cryptography. You're all familiar with this argument. This mantra is also applied to piecing together entire primitives, say a random IV generator of some design (or not - who knows), AES-CBC with some funky padding and a hash based MAC scheme. I then have to put all these primitives into some sort of secure order. There are a lot of variables and options to consider pertinent to my particular requirements. This is not a trivial attempt at just using MD5.

2. Rule 2 is that I can't ask if I've assembled these code elements into some sort of secure order as implementation reviews are off topic. And it means that I certainly can't post code for review. This means that anything that I've produced might be total garbage and useless. The FAQ implies that if there's code it should be on the main Overflow forum. We know though that forum lacks the cryptographic experience to identify nuances in my implementation that might render it insecure. It chiefly focuses on syntax and execution flow.

3. Rule 3. I then think best to use an off the shelf cryptographic library to get Humpty Dumpty talking to Pablo. Unfortunately I can't ask for a recommendation as that's off topic. So I'm left floundering around picking a library that has the nicest looking web site with no knowledge of whether it's any good cryptographically.

4. (Rule 4.) This very question risks being closed as too broad thereby negating even any possibility of finding out how to successfully implement a protocol.

This all leads to me wondering how crypto.SE can actually assist me in producing a working and secure protocol? It seems that I'm caught in a three or four way catch 22.

• I don't know if this is a language issue, but your post has a problem. You have written that you don't understand how it can help someone. What you mean is you don't understand how it can help you. It is self evident from the growth of the site, the upvotes, the comments explaining how helpful the site is etc that it helps lots of people. All the time. – Rory Alsop May 27 '17 at 8:29
• @RoryAlsop Actually you might be highlighting a perfect XY problem. Your (not so) self evidence is no proof of success, only attempts at success. You can't supply any concrete statistics whatsoever regarding the number of secure cryptographic implementations released into the world. Rule 2 precludes collating this data. You're referring to chatter on this forum, but missing the working (or not) deployments. – Paul Uszak May 27 '17 at 23:53
• No Paul, that's not right. That's not what I'm referring to. Not sure exactly what lens you have chosen to look through, but I'm sure you can structure it such that success cannot be identified. I use a practical lens which combines my own experience seeing success (that I'm not going to tell you about as per your rule 2) and seeing indicators of success (votes, acceptances etc) – Rory Alsop May 28 '17 at 8:03

Can crypto.SE help with implementing a secure protocol?

Yes, but not when it comes to practical "software development".

In it's simplest way, one could say Crypto.SE can help you understand what is going on and why, while other SE communities can help you with things like practical implementation and/or finding the tools or libraries you need.

I'll dive into your four points (what you call "rules") to explain the details:

1. Indeed, fact is Crypto.SE doesn't accept questions asking us to review a whole algo or scheme. So don't simply throw a paper (or alike lengthly algo/scheme/protocol description) at us, asking "is this secure?" as that's too broad and boils down to answerers having to write a small book. (To understand the issue with this, it may help to know people earn a living out there writing up such expanded analysis reports and/or papers.)

But we do very well handle sub-analysis of individual building blocks. Quoting the related Meta Q&A which is also linked in our related "on hold" messages:

However, you might like to break your problem down into specifics, such as "under these conditions, does structure X have desired security property Y?" which would be a perfect fit for us.

This is also the reason (among other things) comments to questions frequently ask to clarify the exact scenario that is trying to be solved/handled.

2. It is also correct to notice we don't do code reviews around here. The reason for that is that there is a dedicated community at SE that handles exactly what you're describing; it's called Code Review Stack Exchange.

Users there do a pretty good job pointing out glitches and bugs in coding implementations, and even help optimizing your code in terms of security and performance.

3. You can ask for recommendations at SE, just not at Crypto.SE. Quoting our help center

• If your question is looking for software and/or programming library recommendations, you should post it at Software Recommendations

Fact is I frequently have to merge questions there. Last time I did so was around and about three days ago and — looking at the "thank you" messages I get — users are frequently pretty happy to learn that community exists, as it helps them find the software tools and libraries they're looking for.

4. How to successfully implement a cryptographic algorithm or protocol depends on many things. Most of them were described by yourself…

• it assumes your algo, scheme, or protocol is secure. (You could also implement insecure things, but I'll skip diving into that as that isn't a frequent goal.)
• it assumes you know your way around in the coding language you're using. StackOverflow can help when it comes to learning that. Many of us also answer questions at StackOverflow. The beauty of SO is that it is known to be used by many experts in their individual fields; both cryptographic as well as non-cryptographic (eg Mark Adler, etc.)
• it assumes you don't introduce bugs in your code (which is where CodeReview.SE comes in).
• and sometimes it assumes you use the correct tools and/or libraries to achieve your goal. (see SoftwareRecommendations.SE).

Long story short: what you're describing can't be handled by a single StackExchange community. But if you take a good look around, you'll notice there's an SE site for every part of your problem.

By the way: your example

Humpty Dumpty wants to securely talk to Pablo across the open internet, but doesn't want Candy to be able to listen in. Pablo also wants to know that the messages he's receiving do indeed come from Humpty Dumpy, and that Candy hasn't interfered with them. So I'm looking for some encryption and some authentication.

would be on topic at our site. (Thinking about it, there's even a chance an alike question already exists.)

It would also fit SoftwareRecommendations.SE if you reformulate it, asking for related programs and/or libraries that fit your target operating system(s).

In the end, there are known and well-vetted solutions to your example problem and ready-to-use software solutions exist. This would practically void your need to create your own for your example.

And in case some specific manual raises questions, SuperUser.SE tends to provide a very helping hand in explaining how to correctly use individual software (for example: OpenSSL, GPG/PGP, etc).

So, there is no "Catch 22". Instead, what you're looking at is the huge truckload of hints to the fact that producing a working and secure protocol isn't a piece of cake as it takes a lot of knowledge in multiple areas and it also expects a lot of effort.

If that weren't the case, everyone could do it… which would void the need for specialized programmers, experienced cryptographers, and — last but not least — cryptanalysts. The fact those jobs exist and aren't superfluous pretty much underlines the general problem that "creating your own" definitely ain't easy in the realms of cryptography.

# TL;DR

As our help center explains, we're here to help you grasp the more theoretical side of all things related to cryptography, while other SE communities exist to help you implement and/or use that knowledge practically (as an example: crypto-related software development).

• I'll reluctantly accept your answer, although I strongly disagree with it. I'm coming to the view that crytpo.SE might actually be promoting insecure implementations as a result of these rules. A little knowledge is a dangerous thing, and this site is teaching without testing. No successful organisation makes products this way... – Paul Uszak May 29 '17 at 12:11
• @PaulUszak Actually, as you correctly pointed out in your opening line, this is the site for the academic point of view. Any comparison with a product development is simply not fitting. A better comparison would be e.g. with quantum physics. But where physicists need to run tests and produce statistics to verify a hypothesis, we require mathematical proof. Quite similarly, the people doing research in the area of aerodynamics are not the same people actually building a new plane. – tylo May 31 '17 at 10:29
• @tylo I appreciate your sentiment, but it doesn't quite work like that here does it? The continuous recursive segmentation of the SE estate just makes secure applications harder and harder to produce. Just because the code compiles doesn't make it secure. See Maarten's and my questions... meta.stackoverflow.com/questions/334000/… electronics.meta.stackexchange.com/questions/6111/… – Paul Uszak Jun 1 '17 at 2:09
• @PaulUszak I'm definitely not judging your impression in any way... but If you see a valid problem related to the "continuous recursive segmentation of the SE estate", you're pointing to something no meta can solve. That is, you could try SO.Meta as that's where Joel tends to drop some feedback. But it's probably best and most fitting to contact StackExchange directly (meaning: the company, not some site). We're all merely users forming communities of interest. But it's SE as a company who decides if a community with a specific interest deserves a site. – e-sushi Jun 1 '17 at 9:29