# How to test or analyse an encryption algorithm?

I create an encryption algorithm to encrypt a message and use python to create the code base. And I want to submit a paper on that. But before that, I want to test my algorithm. I haven't any prior knowledge. Here is a similar thread on Crypto SE, but I didn't get what I want to know, hence post this thread.

I want to know what kind of statistical analysis or test I should check before submit my paper in a journal? Or ensure my algorithm is secure enough.

I use composition of several chaotic maps to encrypt the ASCII value of the string

• Recently one asked a question and I've written some comments. Your aim should not be a Journal. For test, you should look at NIST Assess test. Bear in mind that passing this test doesn't prove anything, but failing will. Oct 15, 2021 at 21:29

If you have implemented existing secure algorithm, you can test it against test vectors and give others to review your code. It is not recommended to roll your own implementation (except for fun and learning), but to reuse existing tested library.

If you have implemented your own algorithm, you should not have done that (except for fun). Making sure algorithm is secure is not easy. It is very bad idea to roll your own algorithm. Especially, if you do not have a clue what are you doing (which is the case, if you are asking such question). You can use statistical analysis to analyse algorithms, but you must know what you are doing and it is not enough to do just that. There is no simple test that tells you that algorithm is secure or not.

• Agree @LightBit. But I have to show some test to get accepted my paper. That's why I am asking. Oct 15, 2021 at 19:11
• You have to tell more details, if you want more specific answer. You did not tell us anything about algorithm. What kind of algorithm is it? Oct 15, 2021 at 20:04
• I use composition of several chaotic maps to encrypt the ASCII value of the string @LightBit Oct 15, 2021 at 20:09
• Sounds like (pencil & paper style) stream cipher. You could test for avalanche effect, entropy, average, Chi-squared test, compression test. However this simple tests do not guarantee anything, but if they fail it is not secure at all. Oct 15, 2021 at 20:54
• @WhyMeasureTheory Note that most modern ciphers that are handled by computers are based on binary. How the plaintext message is encoded to binary is then out of scope. It doesn't limit itself to ASCII (a 7 bit character encoding with control characters and an invalid value: 0x7F).
– Maarten Bodewes Mod
Oct 15, 2021 at 21:45
• Also modern stream cipher are build from block cipher or permutation and usualy built from smaller building blocks that make analysis easier. Oct 16, 2021 at 12:19
• I’ve not really weighed in on the ”don’t roll your own” debate, so now’s as good a time as any. This is crypto.se. This is what we do. There are several (niche) areas where rolling your “own” is perfectly acceptable, but just perhaps not maximally efficient. Even Bernstein acknowledges that. Yet efficiency is not the definition of cryptography. Blanket taboos are not the way forward on an enlightened and intellectually challenging scientific forum. It's kinda akin to studying a bicycle for years, but not never being allowed to ride it. Weird. Therefore I disagree. Oct 16, 2021 at 12:36
• Also weird is how to perform analysis of a cipher being off topic on a cryptography forum. There are many counter examples of non migration... Oct 16, 2021 at 12:39
• @PaulUszak How can one design a cipher without knowing what it should achieve? Better question would be "how to design cipher". This question sounds like "I need paper" like I need driving license, but dont know how to drive. Oct 29, 2021 at 16:09