forked from AdrainYe/CTF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KeyBoardPw.py
72 lines (38 loc) · 914 Bytes
/
KeyBoardPw.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!usr/bin/env python
#-*- coding:utf-8 -*-
'''
Usage: KeyBoardPw.py -c (your content)
'''
from optparse import OptionParser
def ArgsModule():
Arg = OptionParser()
Arg.add_option('-c',dest='content',help='Input your content')
options,args = Arg.parse_args()
if options.content is None:
print 'Please input \'-h\' to get help'
exit(0)
return options.content
def Code():
code = {
'a':'q','b':'w','c':'e','d':'r',
'e':'t','f':'y','g':'u','h':'i',
'i':'o','j':'p','k':'a','l':'s',
'm':'d','n':'f','o':'g','p':'h',
'q':'j','r':'k','s':'l','t':'z',
'u':'x','v':'c','w':'v','x':'b',
'y':'n','z':'m'
}
return code
def exp(content):
code = Code()
result = ''
for i in content:
for key,value in code.items():
if value == i:
result = result + key
print result
def main():
content = ArgsModule()
exp(content)
if __name__ == '__main__':
main()