def run(token, word):
""" Check if [word] can decrypt [token]
"""
try:
payload = jwt.decode(token, word, algorithm = 'HS256')
return True
except jwt.exceptions.InvalidTokenError:
logger.debug("InvalidTokenError: {}".format(word))
return False
except jwt.exceptions.DecodeError:
logger.debug("DecodingError: {}".format(word))
return False
except Exception as ex:
logger.exception("Exception: {}".format(ex))
sys.exit(1)
评论列表
文章目录