def get_cipher(self, password, method, op, iv=None):
        password = password.encode('utf-8')
        method = method.lower()
        m = self.get_cipher_len(method)
        if m:
            key, iv_ = EVP_BytesToKey(password, m[0], m[1])
            if iv is None:
                iv = iv_
            iv = iv[:m[1]]
            if op == 1:
                self.cipher_iv = iv[:m[1]]  # this iv is for cipher not decipher
            if method != 'salsa20-ctr':
                import M2Crypto.EVP
                return M2Crypto.EVP.Cipher(method.replace('-', '_'), key, iv,
                                           op, key_as_bytes=0, d='md5',
                                           salt=None, i=1, padding=1)
            else:
                return encrypt_salsa20.Salsa20Cipher(method, key, iv, op)

        logging.error(method % 'method %s not supported')
        sys.exit(1)
dataset/ETHPy150Open apporc/shadowsocks-gtk/shadowsocks_gtk/encrypt.py/Encryptor.get_cipher/swapped operands of `%`