Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I asking for advice on how to check strength of an encryption algorithm.


locked by e-sushi Jun 20 at 15:21

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

By having several competent people review it. – CodesInChaos Feb 5 '13 at 12:11
If you have to ask, it's not secure at all. – Thomas Feb 5 '13 at 12:25
Are you talking about an actual primitive you invented(AES is for wusses, use Samuel's super secure cipher), or are you talking about the way your application uses standard algorithms to encrypt data? – CodesInChaos Feb 5 '13 at 12:36
@Thomas why it isn't secure at all ? – Samuel Medhat Feb 5 '13 at 12:46
@SamuelMedhat Imagine if you'd gone into an aviation forum and asked, "How can I check if the plane I've built is airworthy and reliable?" This type of question is something that needs to be considered before building the system, not after. – Stephen Touset Feb 5 '13 at 23:20
up vote 1 down vote accepted

There are still a lot of unknowns surrounding your question, so I will do my best to answer and fill in the holes as necessary.

One big question that remains is whether you are using already well established cryptographic building blocks (AES, SHA-2, RSA, etc) or whether you have invented some new building block (as CodesInChaos put it "AES is for wusses, use Samuel's super secure cipher"). I'll attempt both.

For the first, the most common way to go about this is through modeling. You model your protocol or setup in some way as to simplify the analysis so that certain properties can be proved. For an example of how this is done, see this paper which proves security for SSH. I'll give you this warning though, modeling necessarily simplifies things and can abstract away flaws. In which case the flaws won't be discovered in the process. This is evidenced by this paper which shows a flaw in SSH that had been abstracted away in the previous analysis. There are also tools to help automate this process as described in this other question.

Instead, assuming the second option above, the best way to begin analyzing Samuel's super secure cipher is to write up an academic-level research paper and publish it in a top journal or conference. See IACR for some pointers. Once all the details are published, the research community will hopefully get involved. The reason for this is Schneier's Law: "Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break."

Many here would say "never design your own". This is very sound advice for real world applications. The only reason I can ever see someone designing their own cryptographic procotol/cipher/scheme/etc is for educational purposes. Only after you have done this for a decade or more, with close mentoring from an established cryptographer, should you even think about designing for a production system. And even then, the advice about publishing still holds.

So, assuming this is for educational purposes, go ahead and design your own, try to publish it if it is something novel or at the very least run some of those analysis/modeling tools on it. But never, never fall to the urge to use the thing.

If you want to learn cryptography: break first, design later. – Thomas Feb 6 '13 at 17:53

The first step is to write a new question on asking for advice on how to check whether if it is secured enough (or not).

The second step is to stop, throw away everything you've done and become an expert in GPG and then port GPG to your platform.

The rationale for being so discouraging is that if you have to ask how to check whether it's secured enough you obviously don't know nearly enough to even start writing an app that encrypts text securely. Many people who would have a very good idea about how to check the security would balk at the task of writing something like GPG themselves.

But what I have done above ? If I have any problem in the way that I asked the question you can edit it. – Samuel Medhat Feb 5 '13 at 12:25
I doubt that it conforms to the general guiding principles of this forum that one posts a particular algorithm and asks how to check whether it is secure enough or not. Could someone clarify that issue? – Mok-Kong Shen Feb 5 '13 at 12:34
@Mok-KongShen Depends on what kind of "encryption algorithm" he's talking about. If he invented an AES alternative(i.e. a symmetric primitive), reviewing that will be off-topic. If he wants to know if using existing primitives in a certain way is secure, that can be on-topic (depending on how its asked). – CodesInChaos Feb 5 '13 at 12:41
@CodesInChaos: Commonly a new algorithm wouldn't likely contain brand-new (invented) primitives but is simply some "presumably" new (advantageous) way of employing (arranging) certain already known types of primitives e.g. S-boxs etc. If one posts such algorithms, could that be on-topic? – Mok-Kong Shen Feb 5 '13 at 12:58
@Mok-KongShen And therefore, bitwise addition is a "primitive" as well. Where should the line be drawn? Obviously, where it matters, and that is always at protocol level (below that, we're talking more about "mathematical primitives" than anything else). Put differently, an S-Box provides no security properties on its own - it is merely a more or less nonlinear mapping - but does in the context of a cipher or a hash function - like DES - where its nonlinearity can be assessed with respect to criteria such as resistance to linear/differential cryptanalysis, etc... – Thomas Feb 6 '13 at 18:10

As many have said, the short answer is probably "no". Not because you asked the question in a wrong way but because the fact that you ask this question implies that you don't know what sort of attacks your application would have to be resilient against. Thus, there is very little hope that you managed to achieve your goal.

Possible attacks your application would have to be able to withstand are linear attacks, differential attacks (and their parents)... And I'm only talking about attacks on the idealised algorithm, not its actual implementation! Then you need to watch out for attackers trying to access memory cells they are not supposed to and other side-channel attacks.

The bottom line is: it is extremely complicated. Even if you use a known algorithm (like the AES), it is very easy to mess up the implementation. That's why you should always use standard libraries which encapsulate all the solutions to these problems or, even better, complete programs (opengpg, openssl...) written by teams of (very) knowledgeable people.


protected by e-sushi Jun 20 at 15:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.