1 """Abstract class for 3DES."""
3 from compat import * #For True
6 def __init__(self, key, mode, IV, implementation):
13 self.isBlockCipher = True
15 self.implementation = implementation
18 #CBC-Mode encryption, returns ciphertext
19 #WARNING: *MAY* modify the input as well
20 def encrypt(self, plaintext):
21 assert(len(plaintext) % 8 == 0)
23 #CBC-Mode decryption, returns plaintext
24 #WARNING: *MAY* modify the input as well
25 def decrypt(self, ciphertext):
26 assert(len(ciphertext) % 8 == 0)