def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL): # Sanity checking of arguments. if(len(key) != 8): raise ValueError('Invalid DES key size.') DesBase.__init__(self, mode, IV, pad, padmode) self.key_size = 8 self.L = [] self.R = [] self.Kn = [[0] * 48] * 16 # 16 48-bit keys (K1 - K16) self.final = [] self.set_key(key)
def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL): DesBase.__init__(self, mode, IV, pad, padmode) self.set_key(key)