how to define key in SubstitutionCryptosystem

asked 2022-04-05 00:32:48 +0100

anonymous user

Anonymous

updated 2022-04-05 19:30:43 +0100

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
edit retag flag offensive close merge delete

Comments

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

Max Alekseyev gravatar imageMax Alekseyev ( 2022-04-05 20:25:12 +0100 )edit