>>>>>> 2---------------------beg: Code NOT working but with an idea (using an alphabet with more than 26 characters):
AS1 = AlphabeticStrings(); AS1
Free alphabetic string monoid on A-Z
AS1([ i for i in range(26) ])
ABCDEFGHIJKLMNOPQRSTUVWXYZ
AS2 = list(AS1.alphabet())+[str(x) for x in range(10)]; AS2
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
len (AS2)
36
AS3 = list(AS1.alphabet())+[str(" ")]; AS3; len (AS3)
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ']
27
keylen=3; H=HillCryptosystem(AS1, keylen);H ### This works fine.
Hill cryptosystem on Free alphabetic string monoid on A-Z of block length 3
keylen=3; H=HillCryptosystem(AS3, keylen);H ### This breaks!
TypeError