'Create a key and an initialization vector'

@staticmethod
def _aes_derive_key_and_iv(b_password, b_salt, key_length, iv_length):

    b_d = b_di = ''
    while (len(b_d) < (key_length + iv_length)):
        b_text = ''.join([b_di, b_password, b_salt])
        b_di = to_bytes(md5(b_text).digest(), errors='strict')
        b_d += b_di
    b_key = b_d[:key_length]
    b_iv = b_d[key_length:(key_length + iv_length)]
    return (b_key, b_iv)
