diff --git a/Zframework/stringExtend.lua b/Zframework/stringExtend.lua index 50399f23..fbb62689 100644 --- a/Zframework/stringExtend.lua +++ b/Zframework/stringExtend.lua @@ -169,6 +169,25 @@ function STRING.vcsDecrypt(text,key) end return result..buffer end +function STRING.digezt(text)--Not powerful hash, just protect the original text + local out={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + local seed=26 + for i=1,#text do + local c=byte(text,i) + seed=(seed+c)%26 + c=c+seed + local pos=c*i%16 + local step=(c+i)%4+1 + local times=2+(c%6) + for _=1,times do + out[pos+1]=(out[pos+1]+c)%256 + pos=(pos+step)%16 + end + end + local result="" + for i=1,16 do result=result..char(out[i])end + return result +end function STRING.readLine(str) local p=str:find("\n") diff --git a/parts/scenes/login.lua b/parts/scenes/login.lua index db0ed718..ea4d10a4 100644 --- a/parts/scenes/login.lua +++ b/parts/scenes/login.lua @@ -10,6 +10,7 @@ local function _login() elseif #password==0 then MES.new('error',text.noPassword)return end + -- password=STRING.digezt(password) NET.wsconn_user_pswd(email,password) if savePW then saveFile({email,password},'conf/account')