Jarlve wrote:doranchak wrote:Incidentally, it only takes a single row swap operation (swap rows 9 and 20) to boost the m2 score from 2202.52 to 2415.13:
I did not know that.
To me, the simplest explanation as to why the cycles in the 340 react well to simple manipulations are because the sequential homophonic substiution is more random. And I think that has to be considered first and foremost. You have posted some numbers but what do you think?
That seems to be a reasonable assumption. Although, there are row swaps that also boost Z408's m2 score, but to a lesser extent.
The row swap "greedy search" algorithm I made does this:
For each possible pair of rows,
1) Swap them and measure the effect on cycle score.
2) Retain only the swap that has the strongest effect.
3) Keep the resulting modified cipher, and repeat steps 1 and 2 until no more improvements are possible.
For Z340, the m2 cycle score goes from 2150.72 to 2778.56 (29.2% improvement) via these swaps:
- Code: Select all
01 HER>pl^VPk|1LTG2d 01 HER>pl^VPk|1LTG2d
02 Np+B(#O%DWY.<*Kf) 02 Np+B(#O%DWY.<*Kf)
03 By:cM+UZGW()L#zHJ 05 _9M+ztjd|5FP+&4k/
04 Spp7^l8*V3pO++RK2 04 Spp7^l8*V3pO++RK2
05 _9M+ztjd|5FP+&4k/ 03 By:cM+UZGW()L#zHJ
06 p8R^FlO-*dCkF>2D( 06 p8R^FlO-*dCkF>2D(
07 #5+Kq%;2UcXGV.zL| 07 #5+Kq%;2UcXGV.zL|
08 (G2Jfj#O+_NYz+@L9 09 d<M+b+ZR2FBcyA64K
09 d<M+b+ZR2FBcyA64K 08 (G2Jfj#O+_NYz+@L9
10 -zlUV+^J+Op7<FBy- 12 2<clRJ|*5T4M.+&BF
11 U+R/5tE|DYBpbTMKO 18 ++)WCzWcPOSHT/()p
12 2<clRJ|*5T4M.+&BF 10 -zlUV+^J+Op7<FBy-
13 z69Sy#+N|5FBc(;8R 14 lGFN^f524b.cV4t++
14 lGFN^f524b.cV4t++ 20 >MDHNpkSzZO8A|K;+
15 yBX1*:49CE>VUZ5-+ 17 RcT+L16C<+FlWB|)L
16 |c.3zBK(Op^.fMqG2 15 yBX1*:49CE>VUZ5-+
17 RcT+L16C<+FlWB|)L 16 |c.3zBK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ed##6e5PORXQF%Gc 22 _ed##6e5PORXQF%Gc
23 Z@JTtq_8JI+rBPQW6 23 Z@JTtq_8JI+rBPQW6
24 VEXr9WI6qEHM)=UIk 24 VEXr9WI6qEHM)=UIk
Since it is a greedy search, it might be getting stuck in local maxima. A good hillclimber would probably find even better combinations of row swap operations.
Expanding the search to include other operations (Swapping columns, swapping rectangular regions, flipping/rotating, etc) will probably find even better improvements to the cycle score, even for Z408.
I think if we consider the hypothesis that cycles were damaged by some transposition operations, we have to be careful about finding many false positives in putative un-transformations. Also, if we include even more kinds of cycling as has been discussed here recently, the "false positive" effect is potentially magnified.