import base64


def _unpackage_encoded(encoded):
    """The encoded string fron _package_encrypted()
    Args:
        encoded(str): the base64 encoded string to take apart
    Return:
        Returns the tuple of encoded string, plain text length, and the iv as a string
    """
    base_str = base64.b64decode(encoded)

    encrypt_len = int(base_str[0:6].decode('utf-8'))
    plain_len = int(base_str[6:12].decode('utf-8'))
    encrypted = base_str[12:encrypt_len+12]
    crypt_iv = base_str[encrypt_len+12:]

    return (encrypted, plain_len, crypt_iv)