def pbkdf2_hex(data, salt, iterations=1000, keylen=24, hashfunc=None):
    hashfunc = hashfunc or sha1
    hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
                               to_bytes(salt), iterations, keylen)
    return binascii.hexlify(hmac)
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.