<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def new(algname, key, encrypt=True, iv=None):
 """ Returns new cipher object ready to encrypt-decrypt data @param algname - string algorithm name like in opemssl command line @param key - binary string representing ciher key @param encrypt - if True (default) cipher would be initialized for encryption, otherwise - for decrypton @param iv - initialization vector """

    ciph_type = CipherType(algname)
    return Cipher(ciph_type, key, iv, encrypt)