#-*- coding:utf-8 -*-
importhashlibimportbase64from urllib importquote,unquoteimportargparse"""名字:CTF之常用工具汇总
作者:白猫
时间:2018-3-22
QQ :1058763824"""
defmenu():
usage= """-m MD5 encryption
-s SH1 encryption
-h Show help information
-b64 Base64 encode
-b32 Base32 encode
-b16 Base16 encode
-db64 Base64 decode
-db32 Base32 decode
-db16 Base16 decode
-urlen URL encode
-urlde URL decode
-bin Binary To Decimal
-octal Octal to Decimal
-hex Hexadecimal to Decimal
-dbin Decimal To Binary
-doctal Decimal to Octal
-dhex Decimal to Hexadecimal
-ord Letter To ASCII Example -ord asdfasfa -ord='dfafs afasfa asfasf'
-chr ASCII To Letters Example -chr 105 -chr = '102 258 654'"""
#在使用ord 和chr命令的时候要注意如果输入的字符和数字不包含空格则直接实用例子前面的命令如果包含空格则使用后面的命令
parser=argparse.ArgumentParser()
parser.add_argument('-m',dest='md',help='MD5 encryption')
parser.add_argument('-s', dest='sh', help='SH1 encryption')
parser.add_argument('--h',action="store_true",help='Show help information')
parser.add_argument('-b64', dest='b64', help='Base64 encode')
parser.add_argument('-b32', dest='b32', help='Base32 encode')
parser.add_argument('-b16', dest='b16&#