This module will take a master key and a url, and then make a new key specific to the url, based
    off the master.
    :param str master_key: Path to the master key used for encryption.
    :param str url: Full URL to the potential file location in S3.
    :returns new_key: The new key that is obtained by hashing the master key:url combination.

def generate_unique_key(master_key, url):
    """
    This module will take a master key and a url, and then make a new key specific to the url, based
    off the master.
    :param str master_key: Path to the master key used for encryption.
    :param str url: Full URL to the potential file location in S3.
    :returns new_key: The new key that is obtained by hashing the master key:url combination.
    """
    with open(master_key, 'r') as keyfile:
        master_key = keyfile.read()
    assert len(master_key) == 32, 'Invalid Key! Must be 32 characters.  Key: %s' % master_key + \
                                  ', Length: %s' % len(master_key)
    new_key = hashlib.sha256(master_key + url).digest()
    assert len(new_key) == 32, 'New key is invalid and is not ' + \
        '32 characters: {}'.format(new_key)
    return new_key