/gdata/tlslite/utils/RC4.py

http://radioappz.googlecode.com/ · Python · 17 lines · 12 code · 4 blank · 1 comment · 2 complexity · b94f3c7eb8656c3ef05e6c691d69fe30 MD5 · raw file

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