(password, method, data)
| 154 | |
| 155 | |
| 156 | def dencrypt_all(password, method, data): |
| 157 | result = [] |
| 158 | method = method.lower() |
| 159 | (key_len, iv_len, m) = method_supported[method] |
| 160 | key = None |
| 161 | if key_len > 0: |
| 162 | key, _ = EVP_BytesToKey(password, key_len, iv_len) |
| 163 | else: |
| 164 | key = password |
| 165 | iv = data[:iv_len] |
| 166 | data = data[iv_len:] |
| 167 | cipher = m(method, key, iv, 0) |
| 168 | result.append(cipher.update(data)) |
| 169 | return b''.join(result), key, iv |
| 170 | |
| 171 | |
| 172 | def encrypt_all(password, method, op, data): |