From 6b6fe73f1c6f86645c3961570899a547e6f8939f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 4 Apr 2023 10:16:44 +0800 Subject: [PATCH 1/2] bugfix --- appPublic/rc4.py | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/appPublic/rc4.py b/appPublic/rc4.py index 86ca3b6..2e34ad0 100755 --- a/appPublic/rc4.py +++ b/appPublic/rc4.py @@ -38,10 +38,11 @@ class RC4: if type(data)==type(''): data = data.encode(self.dcoding) key = key.encode(self.bcoding) - self.encode_bytes(data, key) + code = self.encode_bytes(data, key) if encode: - data = encode(data) - return data.decode(self.dcoding) + code = encode(code) + return code.decode(self.dcoding) + return code def decode_bytes(self, data, key): salt_length = 16 @@ -165,6 +166,35 @@ class KeyChain(object): if d is None: return None return d.decode('utf-8') +pwdkey = 'ytguiojbhvhbnkl' +def password(pwdtxt): + rc = RC4() + code = rc.encode(pwdtxt, pwdkey) + t = rc.decode(code, pwdkey) + if (t == pwdtxt): + return code + else: + return None + +def unpassword(code): + rc = RC4() + t = rc.decode(code, pwdkey) + return t + +""" +if __name__ == '__main__': + import sys + if len(sys.argv) > 1: + print(password(sys.argv[1])) + sys.exit(0) + ps = [ + '45dr6tcfyvguh', + 'ft7gy8uh9ij0', + 'opiluykhcgjfncm' + ] + for p in ps: + print(password(p)) +""" if __name__=='__main__': # 需要加密的数据长度没有限制 From 49c7a8b5e8a68233f701eea7406233cccb3d4e83 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 6 Apr 2023 22:28:27 +0800 Subject: [PATCH 2/2] bugfix --- appPublic/jsonConfig.py | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/appPublic/jsonConfig.py b/appPublic/jsonConfig.py index c3e80b6..789cc13 100755 --- a/appPublic/jsonConfig.py +++ b/appPublic/jsonConfig.py @@ -51,7 +51,7 @@ class JsonConfig(JsonObject): def getConfig(path=None,NS=None): pp = ProgramPath() if path==None: - path = pp + path = os.getcwd() cfname = os.path.abspath(os.path.join(path,"conf","config.json")) # print __name__,cfname ns = { diff --git a/requirements.txt b/requirements.txt index a4c09fd..68d32c4 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ xlrd +bs4 ffpyplayer xlwt nanoid