import base64


def encode_info_basic_http_auth(username, password):
    """
    Encodes the username and password to be sent in the `Authenticate`
    header in http using basic authentication.

    :param username: username
    :param password: password
    :return: encoded value for the http 'Authenticate' header
    """
    user_pass = '{}:{}'.format(username, password)
    user_pass = base64.b64encode(user_pass.encode('ascii')).decode('ascii')

    return 'Basic {}'.format(user_pass)