OLD | NEW |
1 """Abstract class for RC4.""" | 1 """Abstract class for RC4.""" |
2 | 2 |
3 from compat import * #For False | 3 from compat import * #For False |
4 | 4 |
5 class RC4: | 5 class RC4: |
6 def __init__(self, keyBytes, implementation): | 6 def __init__(self, keyBytes, implementation): |
7 if len(keyBytes) < 16 or len(keyBytes) > 256: | 7 if len(keyBytes) < 16 or len(keyBytes) > 256: |
8 raise ValueError() | 8 raise ValueError() |
9 self.isBlockCipher = False | 9 self.isBlockCipher = False |
10 self.name = "rc4" | 10 self.name = "rc4" |
11 self.implementation = implementation | 11 self.implementation = implementation |
12 | 12 |
13 def encrypt(self, plaintext): | 13 def encrypt(self, plaintext): |
14 raise NotImplementedError() | 14 raise NotImplementedError() |
15 | 15 |
16 def decrypt(self, ciphertext): | 16 def decrypt(self, ciphertext): |
17 raise NotImplementedError() | 17 raise NotImplementedError() |
OLD | NEW |