/gdata/tlslite/utils/RC4.py
Python | 17 lines | 12 code | 4 blank | 1 comment | 2 complexity | b94f3c7eb8656c3ef05e6c691d69fe30 MD5 | raw file
1"""Abstract class for RC4.""" 2 3from compat import * #For False 4 5class RC4: 6 def __init__(self, keyBytes, implementation): 7 if len(keyBytes) < 16 or len(keyBytes) > 256: 8 raise ValueError() 9 self.isBlockCipher = False 10 self.name = "rc4" 11 self.implementation = implementation 12 13 def encrypt(self, plaintext): 14 raise NotImplementedError() 15 16 def decrypt(self, ciphertext): 17 raise NotImplementedError()