bcmd 0.0.54__py3-none-any.whl → 0.0.56__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bcmd might be problematic. Click here for more details.
- bcmd/common/password.py +1 -1
- bcmd/tasks/pwd.py +52 -6
- {bcmd-0.0.54.dist-info → bcmd-0.0.56.dist-info}/METADATA +1 -1
- {bcmd-0.0.54.dist-info → bcmd-0.0.56.dist-info}/RECORD +7 -7
- {bcmd-0.0.54.dist-info → bcmd-0.0.56.dist-info}/WHEEL +1 -1
- {bcmd-0.0.54.dist-info → bcmd-0.0.56.dist-info}/entry_points.txt +0 -0
- {bcmd-0.0.54.dist-info → bcmd-0.0.56.dist-info}/top_level.txt +0 -0
bcmd/common/password.py
CHANGED
|
@@ -11,7 +11,7 @@ async def getPypi() -> tuple[str, str]:
|
|
|
11
11
|
with tryRun():
|
|
12
12
|
data = _getData(
|
|
13
13
|
'输入密码(pypi)',
|
|
14
|
-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
14
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Il9fdG9rZW5fXyIsInBhc3N3b3JkIjoicHlwaS1BZ0VJY0hsd2FTNXZjbWNDSkRrM05qWTFOMk5tTFRsaU9URXROR0ZsT1MwNVlUQTBMVFE0WVQ2NlTzlIbkx4RG9Ca3ciLCIzMGE0YTM1Ni0zNmYwLTQ4NTktODk3Zi0xZDFmZDRkMmVhMWQiOjE3MDA4NDU1ODQuNDg5MTY2fQ.YjsYWtUxfsDbHJRQiFSzfuNKDnccC3gxGbAk_bW-LBARCak5EUmlOR1ppWVFBQ0tsc3pMQ0ppT0RBMU16QmhaUzFrTURZekxUUTBZbVF0T0dJMU1pMHdNMlZqWVRSaFlUYzJZV1lpWFFBQUJpQWNvaWxLNlA2TVNZSklETnlvXzcwTXkybzVPWWR3'
|
|
15
15
|
)
|
|
16
16
|
return data['username'], data['password']
|
|
17
17
|
|
bcmd/tasks/pwd.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import getpass
|
|
2
2
|
import json
|
|
3
|
-
import time
|
|
4
3
|
import uuid
|
|
5
4
|
from typing import Final
|
|
6
5
|
|
|
@@ -13,10 +12,14 @@ from rich.console import Console
|
|
|
13
12
|
app: Final = btask.newSubApp('lib 工具')
|
|
14
13
|
|
|
15
14
|
|
|
15
|
+
_KEY_SALT = '_salt_@#%@#xafDGAz.nq'
|
|
16
|
+
_KEY_TEXT = '_text_A!@$,FJ@#adsfkl'
|
|
17
|
+
|
|
18
|
+
|
|
16
19
|
@app.command()
|
|
17
20
|
@syncCall
|
|
18
|
-
async def
|
|
19
|
-
'
|
|
21
|
+
async def encode_json():
|
|
22
|
+
'生成JSON密文(使用剪贴板内容)'
|
|
20
23
|
content = pyperclip.paste()
|
|
21
24
|
try:
|
|
22
25
|
data = json.loads(content)
|
|
@@ -28,7 +31,7 @@ async def encode():
|
|
|
28
31
|
password = getpass.getpass('输入密码:')
|
|
29
32
|
while password != getpass.getpass('再次密码:'):
|
|
30
33
|
pass
|
|
31
|
-
data[str(uuid.uuid4())
|
|
34
|
+
data[_KEY_SALT] = str(uuid.uuid4())
|
|
32
35
|
result = jwt.encode(data, password, algorithm='HS256')
|
|
33
36
|
result = magicSequence(result)
|
|
34
37
|
pyperclip.copy(result)
|
|
@@ -40,8 +43,8 @@ async def encode():
|
|
|
40
43
|
|
|
41
44
|
@app.command()
|
|
42
45
|
@syncCall
|
|
43
|
-
async def
|
|
44
|
-
'
|
|
46
|
+
async def decode_json():
|
|
47
|
+
'还原JSON密文内容(使用剪贴板内容)'
|
|
45
48
|
content = pyperclip.paste()
|
|
46
49
|
bcolor.printYellow(content)
|
|
47
50
|
content = magicSequence(content)
|
|
@@ -50,6 +53,49 @@ async def decode():
|
|
|
50
53
|
password = getpass.getpass('输入密码:')
|
|
51
54
|
try:
|
|
52
55
|
data = jwt.decode(content, password, algorithms=['HS256'])
|
|
56
|
+
if _KEY_SALT in data:
|
|
57
|
+
del data[_KEY_SALT]
|
|
53
58
|
Console().print_json(data=data, indent=4, ensure_ascii=False, sort_keys=True)
|
|
54
59
|
except:
|
|
55
60
|
return btask.abort('无法解析密文')
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@app.command()
|
|
64
|
+
@syncCall
|
|
65
|
+
async def encode_text():
|
|
66
|
+
'生成文本密文(使用剪贴板内容)'
|
|
67
|
+
content = pyperclip.paste()
|
|
68
|
+
bcolor.printYellow(content)
|
|
69
|
+
data = {
|
|
70
|
+
_KEY_TEXT: content,
|
|
71
|
+
_KEY_SALT: str(uuid.uuid4()),
|
|
72
|
+
}
|
|
73
|
+
password = ''
|
|
74
|
+
while not password:
|
|
75
|
+
password = getpass.getpass('输入密码:')
|
|
76
|
+
while password != getpass.getpass('再次密码:'):
|
|
77
|
+
pass
|
|
78
|
+
result = jwt.encode(data, password, algorithm='HS256')
|
|
79
|
+
result = magicSequence(result)
|
|
80
|
+
pyperclip.copy(result)
|
|
81
|
+
print('密文已复制到剪贴板')
|
|
82
|
+
bcolor.printYellow(result)
|
|
83
|
+
bcolor.printGreen('OK')
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@app.command()
|
|
87
|
+
@syncCall
|
|
88
|
+
async def decode_text():
|
|
89
|
+
'还原文本密文内容(使用剪贴板内容)'
|
|
90
|
+
content = pyperclip.paste()
|
|
91
|
+
bcolor.printYellow(content)
|
|
92
|
+
content = magicSequence(content)
|
|
93
|
+
password = ''
|
|
94
|
+
while not password:
|
|
95
|
+
password = getpass.getpass('输入密码:')
|
|
96
|
+
try:
|
|
97
|
+
data = jwt.decode(content, password, algorithms=['HS256'])
|
|
98
|
+
content = data[_KEY_TEXT]
|
|
99
|
+
bcolor.printYellow(content)
|
|
100
|
+
except:
|
|
101
|
+
return btask.abort('无法解析密文')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
bcmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
bcmd/main.py,sha256=_ycMuR_Opl2muPSZAQYTLk9wGM20x_4I0o7eF_HV848,136
|
|
3
3
|
bcmd/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
bcmd/common/password.py,sha256=
|
|
4
|
+
bcmd/common/password.py,sha256=O2TL7S7wLMtatII2N-z68dkX6Y3vF-NKccMffcb69sU,1562
|
|
5
5
|
bcmd/tasks/__init__.py,sha256=JQomljtTMPQbpLv-y0vKSzwFm4_WZdtWzutCAoXq6Ok,205
|
|
6
6
|
bcmd/tasks/bin.py,sha256=4O9Doak-ecOTGvyriZf6v31bhTI66s5IsIKV3wW_cu4,3082
|
|
7
7
|
bcmd/tasks/json.py,sha256=WWOyvcZPYaqQgp-Tkm-uIJschNMBKPKtZN3yXz_SC5s,635
|
|
@@ -9,12 +9,12 @@ bcmd/tasks/lib.py,sha256=l4v9JnsSFicnWfd6lOMa9TIKZn14ybYsIiPX1vCWaho,4350
|
|
|
9
9
|
bcmd/tasks/math.py,sha256=jDLIEhy9Dbz7yHlZQIr7rps6C-rNamiVM7_9tVYdMJk,4302
|
|
10
10
|
bcmd/tasks/mirror.py,sha256=PLRI5XPG9CV44rgQn1mB5U-GRJYnp5wl3Xwsd0_df_Y,1448
|
|
11
11
|
bcmd/tasks/proxy.py,sha256=nAxF9yzk-2O6TeEczGRc3vS3dfe2ZZR1hcGOFU1DS3g,660
|
|
12
|
-
bcmd/tasks/pwd.py,sha256
|
|
12
|
+
bcmd/tasks/pwd.py,sha256=-j6HcZcfKz7U2XhEDAsomY0FdXZwnwqE_yXD5RRZtX0,2885
|
|
13
13
|
bcmd/tasks/task.py,sha256=7AelyK8mTVTfERaagkaUUggP8Md3XC9gurgoakMYf_I,4738
|
|
14
14
|
bcmd/tasks/time.py,sha256=nSIVYov2LsGdxsZAtC91UKXcUtVAqR9o-JmzeuevFhA,2586
|
|
15
15
|
bcmd/tasks/venv.py,sha256=VU34ZZlvqUc4EIlOHayOiJNW4L7v8wsz1Mc-FPfdGVI,4015
|
|
16
|
-
bcmd-0.0.
|
|
17
|
-
bcmd-0.0.
|
|
18
|
-
bcmd-0.0.
|
|
19
|
-
bcmd-0.0.
|
|
20
|
-
bcmd-0.0.
|
|
16
|
+
bcmd-0.0.56.dist-info/METADATA,sha256=whlDDZ3rwGvlTZgKF35pjtH7bAjU76BCF67Vc5Fq0mQ,310
|
|
17
|
+
bcmd-0.0.56.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
18
|
+
bcmd-0.0.56.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
|
|
19
|
+
bcmd-0.0.56.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
|
|
20
|
+
bcmd-0.0.56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|