예제 #1
0
    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)
예제 #2
0
파일: des3.py 프로젝트: hex7c0/EncryptoPy
 def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
     DesBase.__init__(self, mode, IV, pad, padmode)
     self.set_key(key)
예제 #3
0
 def __init__(self, key, mode=ECB, IV=None, pad=None, padmode=PAD_NORMAL):
     DesBase.__init__(self, mode, IV, pad, padmode)
     self.set_key(key)