1
vote
$\begingroup$

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

$\endgroup$
7
  • 4
    $\begingroup$ By having several competent people review it. $\endgroup$ Feb 5, 2013 at 12:11
  • 3
    $\begingroup$ If you have to ask, it's not secure at all. $\endgroup$
    – Thomas
    Feb 5, 2013 at 12:25
  • 2
    $\begingroup$ 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? $\endgroup$ Feb 5, 2013 at 12:36
  • $\begingroup$ @Thomas why it isn't secure at all ? $\endgroup$ Feb 5, 2013 at 12:46
  • 3
    $\begingroup$ @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. $\endgroup$ Feb 5, 2013 at 23:20

3 Answers 3

1
vote
$\begingroup$

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."

Note
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.

$\endgroup$
1
  • 2
    $\begingroup$ If you want to learn cryptography: break first, design later. $\endgroup$
    – Thomas
    Feb 6, 2013 at 17:53
1
vote
$\begingroup$

The first step is to write a new question on crypto.stackexchange.com 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.

$\endgroup$
10
  • $\begingroup$ But what I have done above ? If I have any problem in the way that I asked the question you can edit it. $\endgroup$ Feb 5, 2013 at 12:25
  • $\begingroup$ 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? $\endgroup$ Feb 5, 2013 at 12:34
  • 1
    $\begingroup$ @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). $\endgroup$ Feb 5, 2013 at 12:41
  • $\begingroup$ @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? $\endgroup$ Feb 5, 2013 at 12:58
  • 1
    $\begingroup$ @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... $\endgroup$
    – Thomas
    Feb 6, 2013 at 18:10
1
vote
$\begingroup$

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.

$\endgroup$

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