'Encrypts a Django session key to another 32-character hex value.'

def encrypt_session_key(self, session_key):

    if (not session_key):
        return ''
    key_salt = ('common.djangoapps.track' + self.__class__.__name__)
    key = hashlib.md5((key_salt + settings.SECRET_KEY)).digest()
    encrypted_session_key = hmac.new(key, msg=session_key, digestmod=hashlib.md5).hexdigest()
    return encrypted_session_key
