# How many rounds of encryption is ideal?

I am a newbie to the cryptography world. I am working on a custom algorithm that encrypts the data multiple times and results in a cipher text. It uses a different key in each round to encrypt it. I researched a lot but couldn't find any answer to this question. What do you think is the ideal number for the rounds of encryption when the keys are different in each iteration? Could you show me some math?

Alex

• optimal round count depends on the round structure, the key schedule, and the required security from the cipher Oct 9, 2018 at 2:05
• And if your "round" is actually just a standard application of a strong cipher like AES the answer is "1". Oct 9, 2018 at 6:47
• @SEJPM That was already covered in the previous question of Lock Smith / Alex; this is a logical followup to that question. Unfortunately, we cannot really answer because of the reason stated by Richie: AES has 10 rounds (minimum) while Threefish has a simpler structure and 80 rounds.... Oct 9, 2018 at 18:00
• and this question Oct 9, 2018 at 18:53

How many rounds cannot really be answered as it depends on the design of a (block) cipher. As many as required to withstand attacks found by crypt-analysis, plus quite few more in case the attacks are enhanced is the best we can do.

AES-128 has a mere 10 rounds, but those rounds are rather complex. Threefish has a less complex inner structure, but uses 72 rounds for the 256 bit version. There are attacks on Threefish that break 53 of 72 rounds. If the rounds could be compromised that easily for AES then it would be utterly broken. Fortunately the best known attack against AES-128 covers 8 rounds out of 10 - and because it is a key distinguishing attack it doesn't give all that much power to an attacker either.

So for your own cipher you'll have to try to find out how well it withstands all known attacks. This is very hard thing to do and it is unlikely that you will succeed without help. This is one of the reasons why it is hard to design a cipher. Another is to avoid meet-in-the-middle attacks between the rounds of the cipher.

• Isn't there some really bad lightweight cipher that uses something like 700 rounds?
– forest
Jan 4, 2021 at 5:57
• @Maarten Bodewes: I copy from here: en.wikipedia.org/wiki/Advanced_Encryption_Standard "It works on the 8-round version of AES-128, with a time complexity of 2^48, and a memory complexity of 2^32. 128-bit AES uses 10 rounds, so this attack is not effective against full AES-128." I want to ask this: How do I calculate the O(n) for every AES round? For instance a 3-round AES what O(n) does it have? Aug 22 at 18:54
• @just_learning The big $\mathcal{O}$ notation is basically the order of operations. what an operation is is context specific. Normally you'd use it for a single block encrypt / decrypt of the block cipher (presuming that that's needed to attack the cipher). However, you can define it to be a single round as well; in short, $\mathcal{O}$ is context specific. Aug 22 at 21:35
• Who cares about that? You can just rent CPU time from a cloud provider. Aug 22 at 22:17
• Sure, but I'd not try 2^48 if I had to wait for the result. 2^32 is only 4 billion, and your computer seems to manage 4 billion clock cycles sustained apparently (which I think is unlikely, but hey, maybe you've got one of these gaming laptops). Aug 23 at 16:45