OLD | NEW |
| 1 # Author: Trevor Perrin |
| 2 # See the LICENSE file for legal information regarding use of this file. |
| 3 |
1 """Abstract class for RC4.""" | 4 """Abstract class for RC4.""" |
2 | 5 |
3 from compat import * #For False | |
4 | 6 |
5 class RC4: | 7 class RC4(object): |
6 def __init__(self, keyBytes, implementation): | 8 def __init__(self, keyBytes, implementation): |
7 if len(keyBytes) < 16 or len(keyBytes) > 256: | 9 if len(keyBytes) < 16 or len(keyBytes) > 256: |
8 raise ValueError() | 10 raise ValueError() |
9 self.isBlockCipher = False | 11 self.isBlockCipher = False |
10 self.name = "rc4" | 12 self.name = "rc4" |
11 self.implementation = implementation | 13 self.implementation = implementation |
12 | 14 |
13 def encrypt(self, plaintext): | 15 def encrypt(self, plaintext): |
14 raise NotImplementedError() | 16 raise NotImplementedError() |
15 | 17 |
16 def decrypt(self, ciphertext): | 18 def decrypt(self, ciphertext): |
17 raise NotImplementedError() | 19 raise NotImplementedError() |
OLD | NEW |