def write_encrypted_file(filename, encrypted_data):
    """
    Write an encrypted bytestring to file
    """
    filename = filename + '.enc'

    with open(filename, "wb") as file:
        file.write(encrypted_data)

    return filename