blob: a5c02aa48d9f65e34189bcaf829bd5ade345529b [file] [log] [blame]
Guido van Rossum228b8e81997-04-02 06:13:34 +00001import rotor
2
3r = rotor.newrotor("you'll never guess this")
4r = rotor.newrotor("you'll never guess this", 12)
5
6A = 'spam and eggs'
7B = 'cheese shop'
8
9a = r.encrypt(A)
Guido van Rossumff712aa1997-08-15 00:45:26 +000010print `a`
Guido van Rossum228b8e81997-04-02 06:13:34 +000011b = r.encryptmore(B)
Guido van Rossuma11cccc1997-10-06 20:19:59 +000012print `b`
Guido van Rossum228b8e81997-04-02 06:13:34 +000013
14A1 = r.decrypt(a)
15print A1
16if A1 <> A:
17 print 'decrypt failed'
18
19B1 = r.decryptmore(b)
20print B1
21if B1 <> B:
22 print 'decryptmore failed'
23
24try:
25 r.setkey()
26except TypeError:
27 pass
28r.setkey('you guessed it!')