how to define key in SubstitutionCryptosystem

asked 3 years ago

anonymous user

Anonymous

updated 3 years ago

Max Alekseyev gravatar image

if I want to define key=WERGERBNHFDGDVS, how can I replace it

S = SubstitutionCryptosystem(AlphabeticStrings())
K = S.random_key()
M = S.encoding("Don't substitute me.")
S.deciphering(K, S.enciphering(K, M)) == M
True
Preview: (hide)

Comments

Use K = 'WERGERBNHFDGDVS' instead of K = S.random_key().

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )