im writing another encryption algorithm, and it involves expanding the key.

to make the decryption keys, the encryption keys are made first, and then edited

on the computer, i labeled the keys 0-51, rather than 1-52,so every index is 1 less than the indexes shown below

```
s49* s50# s51# s52* s47 s48
s43* s45# s44# s46* s41 s42
s37* s39# s38# s39* s35 s36
s31* s33# s32# s34* s29 s30
s25* s27# s26# s28* s23 s24
s19* s21# s20# s22* s17 s18
s13* s15# s14# s16* s11 s12
s7* s9# s8# s10* s5 s6
s1* s2# s3# s4*
sXX* = multiplicative inverse of sXX modulus ((2^16)+1)
sXX# = additive inverse of sXX modulus (2^16)
```

for x in range(8): key += [invmod(temp[48-6*x]), two_comp(temp[50-6*x]), # i know these 2 are switched, but for some reason, two_comp(temp[49-6*x]), # they give the right outputs for the others invmod(temp[51-6*x]), temp[46-6*x], temp[47-6*x] ] key += [invmod(temp[0]),two_comp(temp[1]),two_comp(temp[2]),invmod(temp[3])] # invmod is multiplicative inverse # two_comp is additive inverse

This is what im getting:

0011 **2233 4455** 6677 8899 aabb

ccdd eeff 6688 aacc ef11 3355

7799 bbdd fe00 2244 99de 2266

aaef 3377 bbfc 0044 88cd 1155

cd55 de66 ef77 f800 8911 9a22

ab33 bc44 cdde eff0 0112 2334

4556 6778 899a abbc e002 2446

688a acce f113 3557 799b bddf

8cd1 1559 9de2 266a

This is the correct output

0011 **4455 2233** 6677 8899 aabb

ccdd eeff 6688 aacc ef11 3355

7799 bbdd fe00 2244 99de 2266

aaef 3377 bbfc 0044 88cd 1155

cd55 de66 ef77 f800 8911 9a22

ab33 bc44 cdde eff0 0112 2334

4556 6778 899a abbc e002 2446

688a acce f113 3557 799b bddf

8cd1 1559 9de2 266a

Can anyone tell me why this is happening?

Visit Calccrypto for info on crypto

KC2ZOF