gomyck-tools 1.2.0__tar.gz → 1.2.2__tar.gz

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.
Files changed (66) hide show
  1. gomyck-tools-1.2.2/PKG-INFO +31 -0
  2. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/api_result.py +0 -2
  3. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/cjson.py +5 -5
  4. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/ckafka.py +3 -3
  5. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/date_utils.py +1 -1
  6. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/dict_wrapper.py +3 -1
  7. gomyck-tools-1.2.2/ctools/rsa.py +70 -0
  8. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/sm_tools.py +17 -4
  9. gomyck-tools-1.2.2/gomyck_tools.egg-info/PKG-INFO +31 -0
  10. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/gomyck_tools.egg-info/SOURCES.txt +1 -1
  11. gomyck-tools-1.2.2/gomyck_tools.egg-info/requires.txt +17 -0
  12. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/setup.py +1 -1
  13. gomyck-tools-1.2.0/PKG-INFO +0 -30
  14. gomyck-tools-1.2.0/ctools/license.py +0 -37
  15. gomyck-tools-1.2.0/gomyck_tools.egg-info/PKG-INFO +0 -30
  16. gomyck-tools-1.2.0/gomyck_tools.egg-info/requires.txt +0 -16
  17. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/README.md +0 -0
  18. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/__init__.py +0 -0
  19. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/aes_tools.py +0 -0
  20. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/application.py +0 -0
  21. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/b64.py +0 -0
  22. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/bashPath.py +0 -0
  23. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/bottle_web_base.py +0 -0
  24. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/bottle_webserver.py +0 -0
  25. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/bottle_websocket.py +0 -0
  26. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/browser_element_tools.py +0 -0
  27. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/call.py +0 -0
  28. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/compile_tools.py +0 -0
  29. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/console.py +0 -0
  30. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/cron_lite.py +0 -0
  31. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/database.py +0 -0
  32. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/douglas_rarefy.py +0 -0
  33. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/download_tools.py +0 -0
  34. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/enums.py +0 -0
  35. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/ex.py +0 -0
  36. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/excelOpt.py +0 -0
  37. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/html_soup.py +0 -0
  38. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/http_utils.py +0 -0
  39. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/images_tools.py +0 -0
  40. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/imgDialog.py +0 -0
  41. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/metrics.py +0 -0
  42. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/mqtt_utils.py +0 -0
  43. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/obj.py +0 -0
  44. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/pacth.py +0 -0
  45. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/plan_area_tools.py +0 -0
  46. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/process_pool.py +0 -0
  47. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/pty_tools.py +0 -0
  48. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/resource_bundle_tools.py +0 -0
  49. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/screenshot_tools.py +0 -0
  50. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/sign.py +0 -0
  51. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/snow_id.py +0 -0
  52. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/strDiff.py +0 -0
  53. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/string_tools.py +0 -0
  54. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/sys_info.py +0 -0
  55. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/sys_log.py +0 -0
  56. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/thread_pool.py +0 -0
  57. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/upload_tools.py +0 -0
  58. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/win_canvas.py +0 -0
  59. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/win_control.py +0 -0
  60. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/wordFill.py +0 -0
  61. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/word_fill.py +0 -0
  62. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/word_fill_entity.py +0 -0
  63. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/ctools/work_path.py +0 -0
  64. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/gomyck_tools.egg-info/dependency_links.txt +0 -0
  65. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/gomyck_tools.egg-info/top_level.txt +0 -0
  66. {gomyck-tools-1.2.0 → gomyck-tools-1.2.2}/setup.cfg +0 -0
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.1
2
+ Name: gomyck-tools
3
+ Version: 1.2.2
4
+ Summary: A ctools for python development by hao474798383
5
+ Home-page: https://blog.gomyck.com
6
+ Author: gomyck
7
+ Author-email: hao474798383@163.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: jsonpickle~=3.4.2
14
+ Requires-Dist: SQLAlchemy~=2.0.36
15
+ Requires-Dist: chardet~=5.2.0
16
+ Requires-Dist: psycopg2-binary~=2.9.10
17
+ Requires-Dist: croniter~=5.0.1
18
+ Requires-Dist: gmssl~=3.2.2
19
+ Requires-Dist: psutil~=6.1.0
20
+ Requires-Dist: jsonpath_ng~=1.7.0
21
+ Requires-Dist: bottle~=0.13.2
22
+ Requires-Dist: requests~=2.32.3
23
+ Requires-Dist: urllib3~=1.26.20
24
+ Requires-Dist: kafka-python~=2.0.2
25
+ Requires-Dist: bs4~=0.0.2
26
+ Requires-Dist: paho-mqtt~=2.1.0
27
+ Requires-Dist: fuzzywuzzy~=0.18.0
28
+ Requires-Dist: pymysql~=1.1.1
29
+ Requires-Dist: pyzipper==0.3.6
30
+
31
+ this package is for python development
@@ -2,8 +2,6 @@ from ctools import cjson
2
2
 
3
3
  cjson.str_value_keys = [
4
4
  "obj_id",
5
- "script_id",
6
- "template_id"
7
5
  ]
8
6
 
9
7
 
@@ -6,7 +6,7 @@ jsonpickle.set_preferred_backend('json')
6
6
  jsonpickle.set_encoder_options('json', ensure_ascii=False)
7
7
  jsonpickle.set_decoder_options('json')
8
8
 
9
- def dumps(obj) -> str:
9
+ def dumps(obj, **kwargs) -> str:
10
10
  """
11
11
  将对象转换为json字符串
12
12
  :param obj: 对象
@@ -14,18 +14,18 @@ def dumps(obj) -> str:
14
14
  """
15
15
  if obj is None: return None
16
16
  if type(obj) == str: return obj
17
- return f'{jsonpickle.encode(obj, unpicklable=False)}'
17
+ return f'{jsonpickle.encode(obj, unpicklable=False, make_refs=False, **kwargs)}'
18
18
 
19
- def loads(json_str: str) -> dict:
19
+ def loads(json_str: str, **kwargs) -> dict:
20
20
  """
21
21
  将json字符串转换为对象
22
22
  :param json_str: json 字符串
23
23
  :return: 对象
24
24
  """
25
- return jsonpickle.decode(json_str)
25
+ return jsonpickle.decode(json_str, **kwargs)
26
26
 
27
27
  def unify_to_str(json_str: str) -> str:
28
- if not str_value_keys: return json_str
28
+ if not str_value_keys and len(str_value_keys) == 0: return json_str
29
29
  obj = loads(json_str)
30
30
  if isinstance(obj, list):
31
31
  _handle_list(obj)
@@ -28,7 +28,7 @@ def send_msg():
28
28
  while True:
29
29
  command = input('发送消息: Y/n \n')
30
30
  if command.strip() not in ['N', 'n']:
31
- producer.send_msg('jqxx-lib', '{{"jqid": "{}", "xxxx": "{}=={}"}}'.format(string_tools.get_snowflake_id(), command.strip(), datetime.strftime(datetime.now(), '%Y-%m-%d %H:%M:%S')))
31
+ producer.send_msg('jqxx', '{{"jqid": "{}", "xxxx": "{}"}}'.format(string_tools.get_snowflake_id(), datetime.strftime(datetime.now(), '%Y-%m-%d %H:%M:%S')))
32
32
  else:
33
33
  break
34
34
 
@@ -38,9 +38,9 @@ def consumer_callback(msg):
38
38
  print(msg)
39
39
  return True
40
40
 
41
- consumer.receive_msg('jqxx-lib', callBack=consumer_callback)
41
+ consumer.receive_msg('jqxx', callBack=consumer_callback)
42
42
 
43
- time.sleep(10000)
43
+ while True: time.sleep(1)
44
44
  """
45
45
  class KafkaInstance:
46
46
  def __init__(self, producer: KafkaProducer, consumer: KafkaConsumer):
@@ -30,7 +30,7 @@ def get_file_time():
30
30
  获取 %Y-%m-%d %H:%M:%S 文件格式时间
31
31
  :return:
32
32
  """
33
- return time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime(time.time()))
33
+ return time.strftime('%Y-%m-%d_%H-%M-%S-%s', time.localtime(time.time()))
34
34
 
35
35
  def get_timestamp(offset=0):
36
36
  return int(time.time() + offset)
@@ -6,7 +6,9 @@ __date__ = '2024/10/25 09:42'
6
6
  class DictWrapper(dict):
7
7
  def __getattr__(self, key):
8
8
  res = self.get(key)
9
- if type(res) == dict:
9
+ if res is None:
10
+ raise AttributeError(f"'{key}' not found in this Entity")
11
+ if isinstance(res, dict):
10
12
  return DictWrapper(res)
11
13
  return res
12
14
 
@@ -0,0 +1,70 @@
1
+ import base64
2
+
3
+ from Crypto.Cipher import PKCS1_OAEP
4
+ from Crypto.PublicKey import RSA
5
+ from Crypto.Signature import pkcs1_15
6
+ from Crypto.Hash import SHA256
7
+
8
+ from ctools import work_path, cjson
9
+
10
+ ENCRYPT_CHUNK_SIZE = 245
11
+ decrypt_CHUNK_SIZE = 512
12
+
13
+ def generate_rsa_keypair(bits=2048):
14
+ key = RSA.generate(bits)
15
+ private_key = key.export_key() # 导出私钥
16
+ public_key = key.publickey().export_key() # 导出公钥
17
+ with open("private_key.pem", "wb") as f:
18
+ f.write(private_key)
19
+ with open("public_key.pem", "wb") as f:
20
+ f.write(public_key)
21
+
22
+ def loadLicenseInfo(auth_code):
23
+ with open(work_path.get_app_path() + '/keys/license.key', 'r') as pri:
24
+ decrypt_message = decrypt(auth_code.strip(), pri.read())
25
+ return cjson.loads(decrypt_message)
26
+
27
+ # 加密函数
28
+ def encrypt(msg, public_key):
29
+ parts = b''
30
+ public_key = RSA.import_key(public_key)
31
+ cipher = PKCS1_OAEP.new(public_key)
32
+ for i in range(0, len(msg), ENCRYPT_CHUNK_SIZE):
33
+ parts += cipher.encrypt(msg[i:i + ENCRYPT_CHUNK_SIZE].encode())
34
+ encrypted_base64 = base64.b64encode(parts)
35
+ return encrypted_base64.decode()
36
+
37
+ # 解密函数
38
+ def decrypt(msg, private_key):
39
+ parts = b''
40
+ public_key = RSA.import_key(private_key)
41
+ cipher = PKCS1_OAEP.new(public_key)
42
+ encrypted_bytes = base64.b64decode(msg)
43
+ for i in range(0, len(encrypted_bytes), decrypt_CHUNK_SIZE):
44
+ parts += cipher.decrypt(encrypted_bytes[i:i + decrypt_CHUNK_SIZE])
45
+ return parts.decode()
46
+
47
+ # 验签
48
+ def verify_sign(msg, public_key, sign):
49
+ public_key = RSA.import_key(public_key)
50
+ hash_message = SHA256.new(msg.encode())
51
+ try:
52
+ pkcs1_15.new(public_key).verify(hash_message, base64.b64decode(sign.encode()))
53
+ return True
54
+ except Exception as e:
55
+ print('签名验证失败: {}'.format(e))
56
+ return False
57
+
58
+ # 签名
59
+ def sign_msg(msg, private_key):
60
+ private_key = RSA.import_key(private_key)
61
+ hash_message = SHA256.new(msg.encode())
62
+ signature = pkcs1_15.new(private_key).sign(hash_message)
63
+ return base64.b64encode(signature).decode()
64
+
65
+
66
+ # with open(work_path.get_current_path() + '/private_key.pem', 'r') as key:
67
+ # key = key.read()
68
+ # sign = sign_msg(key, key)
69
+ # with open(work_path.get_current_path() + '/public_key.pem', 'r') as pub:
70
+ # print(verify_sign(key, pub.read(), sign+'123'))
@@ -3,22 +3,35 @@ import base64
3
3
  from gmssl import sm2, func
4
4
  from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
5
5
 
6
- sm2_crypt: sm2.CryptSM2
6
+ sm2_crypt: sm2.CryptSM2 = None
7
7
 
8
+ def init(private_key: str, public_key: str):
9
+ global sm2_crypt
10
+ if sm2_crypt is not None:
11
+ print('sm2 is already init!!!')
12
+ return
13
+ sm2_crypt = sm2.CryptSM2(private_key=private_key, public_key=public_key, asn1=True, mode=1)
8
14
 
9
15
  def sign_with_sm2(sign_data: str) -> str:
10
- return sm2_crypt.sign(sign_data.encode('UTF-8'), func.random_hex(sm2_crypt.para_len))
16
+ if sm2_crypt is None: raise Exception('sm2 is not init!!!')
17
+ return sm2_crypt.sign_with_sm3(sign_data.encode('UTF-8'))
11
18
 
12
19
 
13
20
  def verify_with_sm2(sign_val: str, sign_data: str) -> bool:
14
- return sm2_crypt.verify(sign_val, sign_data.encode('UTF-8'))
15
-
21
+ if sm2_crypt is None: raise Exception('sm2 is not init!!!')
22
+ try:
23
+ return sm2_crypt.verify_with_sm3(sign_val, sign_data.encode('UTF-8'))
24
+ except Exception as e:
25
+ print('签名验证失败: {}'.format(e))
26
+ return False
16
27
 
17
28
  def encrypt_with_sm2(encrypt_data: str) -> str:
29
+ if sm2_crypt is None: raise Exception('sm2 is not init!!!')
18
30
  return base64.b64encode(sm2_crypt.encrypt(encrypt_data.encode('UTF-8'))).decode('UTF-8')
19
31
 
20
32
 
21
33
  def decrypt_with_sm2(encrypt_data: str) -> str:
34
+ if sm2_crypt is None: raise Exception('sm2 is not init!!!')
22
35
  return sm2_crypt.decrypt(base64.b64decode(encrypt_data.encode('UTF-8'))).decode('UTF-8')
23
36
 
24
37
 
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.1
2
+ Name: gomyck-tools
3
+ Version: 1.2.2
4
+ Summary: A ctools for python development by hao474798383
5
+ Home-page: https://blog.gomyck.com
6
+ Author: gomyck
7
+ Author-email: hao474798383@163.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: jsonpickle~=3.4.2
14
+ Requires-Dist: SQLAlchemy~=2.0.36
15
+ Requires-Dist: chardet~=5.2.0
16
+ Requires-Dist: psycopg2-binary~=2.9.10
17
+ Requires-Dist: croniter~=5.0.1
18
+ Requires-Dist: gmssl~=3.2.2
19
+ Requires-Dist: psutil~=6.1.0
20
+ Requires-Dist: jsonpath_ng~=1.7.0
21
+ Requires-Dist: bottle~=0.13.2
22
+ Requires-Dist: requests~=2.32.3
23
+ Requires-Dist: urllib3~=1.26.20
24
+ Requires-Dist: kafka-python~=2.0.2
25
+ Requires-Dist: bs4~=0.0.2
26
+ Requires-Dist: paho-mqtt~=2.1.0
27
+ Requires-Dist: fuzzywuzzy~=0.18.0
28
+ Requires-Dist: pymysql~=1.1.1
29
+ Requires-Dist: pyzipper==0.3.6
30
+
31
+ this package is for python development
@@ -28,7 +28,6 @@ ctools/html_soup.py
28
28
  ctools/http_utils.py
29
29
  ctools/images_tools.py
30
30
  ctools/imgDialog.py
31
- ctools/license.py
32
31
  ctools/metrics.py
33
32
  ctools/mqtt_utils.py
34
33
  ctools/obj.py
@@ -37,6 +36,7 @@ ctools/plan_area_tools.py
37
36
  ctools/process_pool.py
38
37
  ctools/pty_tools.py
39
38
  ctools/resource_bundle_tools.py
39
+ ctools/rsa.py
40
40
  ctools/screenshot_tools.py
41
41
  ctools/sign.py
42
42
  ctools/sm_tools.py
@@ -0,0 +1,17 @@
1
+ jsonpickle~=3.4.2
2
+ SQLAlchemy~=2.0.36
3
+ chardet~=5.2.0
4
+ psycopg2-binary~=2.9.10
5
+ croniter~=5.0.1
6
+ gmssl~=3.2.2
7
+ psutil~=6.1.0
8
+ jsonpath_ng~=1.7.0
9
+ bottle~=0.13.2
10
+ requests~=2.32.3
11
+ urllib3~=1.26.20
12
+ kafka-python~=2.0.2
13
+ bs4~=0.0.2
14
+ paho-mqtt~=2.1.0
15
+ fuzzywuzzy~=0.18.0
16
+ pymysql~=1.1.1
17
+ pyzipper==0.3.6
@@ -11,7 +11,7 @@ requirements = parse_requirements(os.path.join(os.path.dirname(__file__), 'requi
11
11
 
12
12
  setup(
13
13
  name="gomyck-tools",
14
- version="1.2.0",
14
+ version="1.2.2",
15
15
  author="gomyck",
16
16
  author_email="hao474798383@163.com",
17
17
  description="A ctools for python development by hao474798383",
@@ -1,30 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: gomyck-tools
3
- Version: 1.2.0
4
- Summary: A ctools for python development by hao474798383
5
- Home-page: https://blog.gomyck.com
6
- Author: gomyck
7
- Author-email: hao474798383@163.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.8
12
- Description-Content-Type: text/markdown
13
- Requires-Dist: jsonpickle==3.4.2
14
- Requires-Dist: SQLAlchemy>=2.0.36
15
- Requires-Dist: chardet>=5.2.0
16
- Requires-Dist: psycopg2-binary>=2.9.10
17
- Requires-Dist: croniter>=5.0.1
18
- Requires-Dist: gmssl>=3.2.2
19
- Requires-Dist: psutil>=6.1.0
20
- Requires-Dist: jsonpath_ng>=1.7.0
21
- Requires-Dist: bottle==0.13.2
22
- Requires-Dist: requests==2.32.3
23
- Requires-Dist: urllib3==1.26.20
24
- Requires-Dist: kafka-python==2.0.2
25
- Requires-Dist: bs4==0.0.2
26
- Requires-Dist: paho-mqtt==2.1.0
27
- Requires-Dist: fuzzywuzzy==0.18.0
28
- Requires-Dist: pymysql==1.1.1
29
-
30
- this package is for python development
@@ -1,37 +0,0 @@
1
- import base64
2
-
3
- from Crypto.Cipher import PKCS1_OAEP
4
- from Crypto.PublicKey import RSA
5
-
6
- from ctools import work_path, cjson
7
-
8
- ENCRYPT_CHUNK_SIZE = 245
9
- decrypt_CHUNK_SIZE = 512
10
-
11
-
12
- # 加密函数
13
- def encrypt(msg, public_key):
14
- parts = b''
15
- private_key = RSA.import_key(public_key)
16
- cipher = PKCS1_OAEP.new(private_key)
17
- for i in range(0, len(msg), ENCRYPT_CHUNK_SIZE):
18
- parts += cipher.encrypt(msg[i:i + ENCRYPT_CHUNK_SIZE].encode())
19
- encrypted_base64 = base64.b64encode(parts)
20
- return encrypted_base64.decode()
21
-
22
-
23
- # 解密函数
24
- def decrypt(msg, private_key):
25
- parts = b''
26
- public_key = RSA.import_key(private_key)
27
- cipher = PKCS1_OAEP.new(public_key)
28
- encrypted_bytes = base64.b64decode(msg)
29
- for i in range(0, len(encrypted_bytes), decrypt_CHUNK_SIZE):
30
- parts += cipher.decrypt(encrypted_bytes[i:i + decrypt_CHUNK_SIZE])
31
- return parts.decode()
32
-
33
-
34
- def loadLicenseInfo(auth_code):
35
- with open(work_path.get_app_path() + '/keys/license.key', 'r') as pri:
36
- decrypt_message = decrypt(auth_code.strip(), pri.read())
37
- return cjson.loads(decrypt_message)
@@ -1,30 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: gomyck-tools
3
- Version: 1.2.0
4
- Summary: A ctools for python development by hao474798383
5
- Home-page: https://blog.gomyck.com
6
- Author: gomyck
7
- Author-email: hao474798383@163.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.8
12
- Description-Content-Type: text/markdown
13
- Requires-Dist: jsonpickle==3.4.2
14
- Requires-Dist: SQLAlchemy>=2.0.36
15
- Requires-Dist: chardet>=5.2.0
16
- Requires-Dist: psycopg2-binary>=2.9.10
17
- Requires-Dist: croniter>=5.0.1
18
- Requires-Dist: gmssl>=3.2.2
19
- Requires-Dist: psutil>=6.1.0
20
- Requires-Dist: jsonpath_ng>=1.7.0
21
- Requires-Dist: bottle==0.13.2
22
- Requires-Dist: requests==2.32.3
23
- Requires-Dist: urllib3==1.26.20
24
- Requires-Dist: kafka-python==2.0.2
25
- Requires-Dist: bs4==0.0.2
26
- Requires-Dist: paho-mqtt==2.1.0
27
- Requires-Dist: fuzzywuzzy==0.18.0
28
- Requires-Dist: pymysql==1.1.1
29
-
30
- this package is for python development
@@ -1,16 +0,0 @@
1
- jsonpickle==3.4.2
2
- SQLAlchemy>=2.0.36
3
- chardet>=5.2.0
4
- psycopg2-binary>=2.9.10
5
- croniter>=5.0.1
6
- gmssl>=3.2.2
7
- psutil>=6.1.0
8
- jsonpath_ng>=1.7.0
9
- bottle==0.13.2
10
- requests==2.32.3
11
- urllib3==1.26.20
12
- kafka-python==2.0.2
13
- bs4==0.0.2
14
- paho-mqtt==2.1.0
15
- fuzzywuzzy==0.18.0
16
- pymysql==1.1.1
File without changes
File without changes
File without changes
File without changes
File without changes