(self, password, method)
| 70 | |
| 71 | class Encryptor(object): |
| 72 | def __init__(self, password, method): |
| 73 | self.password = password |
| 74 | self.key = None |
| 75 | self.method = method |
| 76 | self.iv_sent = False |
| 77 | self.cipher_iv = b'' |
| 78 | self.decipher = None |
| 79 | self.decipher_iv = None |
| 80 | method = method.lower() |
| 81 | self._method_info = self.get_method_info(method) |
| 82 | if self._method_info: |
| 83 | self.cipher = self.get_cipher(password, method, 1, |
| 84 | random_string(self._method_info[1])) |
| 85 | else: |
| 86 | logging.error('method %s not supported' % method) |
| 87 | sys.exit(1) |
| 88 | |
| 89 | def get_method_info(self, method): |
| 90 | method = method.lower() |
nothing calls this directly
no test coverage detected