10/10/2018, 13:19
Password bị mã bó bằng hàm này làm sao giải mã được ?
Chào các anh chị.
Website đã đổi pass nhưng mà ko nhớ. lục lại trong database SQL server thì thấy pass là một chuỗi ký tự: 0P433WX49W9992V1.
Mở code thì thấy pass được mã hóa bằng hàm: EncodePassword
Nội dung hàm EncodePassword như sau:
<%function EncodePassword(sname, spass)
if isnull(sname) then
sname = " "
end if
if isnull(spass) then
spass = " "
end if
ss = ""
sname = trim(LCase(sname))
spass = trim(LCase(spass))
if spass = "" then
spass = "sname"
end if
pss = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
iss = len(pss)
i1 = len(sname)
i2 = len(spass)
if i2>8 then
i2 = 8
end if
for i=1 to i2
j = (i mod i1)+1
k = (i mod 2)
j1 = asc(mid(sname,j,1))
j2 = asc(mid(spass,i,1))
j1 = (j1 mod iss)+1
j2 = (j2 mod iss)+1
j2 = (j2 mod 10)+1
if k=0 then
ss = ss + mid(pss,j1,1) + mid(pss,j2,1)
else
ss = ss + mid(pss,j2,1) + mid(pss,j1,1)
end if
next
EncodePassword = ss
end function%>
LÀm cách nào để lấy lại pass ?
Website đã đổi pass nhưng mà ko nhớ. lục lại trong database SQL server thì thấy pass là một chuỗi ký tự: 0P433WX49W9992V1.
Mở code thì thấy pass được mã hóa bằng hàm: EncodePassword
Nội dung hàm EncodePassword như sau:
<%function EncodePassword(sname, spass)
if isnull(sname) then
sname = " "
end if
if isnull(spass) then
spass = " "
end if
ss = ""
sname = trim(LCase(sname))
spass = trim(LCase(spass))
if spass = "" then
spass = "sname"
end if
pss = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
iss = len(pss)
i1 = len(sname)
i2 = len(spass)
if i2>8 then
i2 = 8
end if
for i=1 to i2
j = (i mod i1)+1
k = (i mod 2)
j1 = asc(mid(sname,j,1))
j2 = asc(mid(spass,i,1))
j1 = (j1 mod iss)+1
j2 = (j2 mod iss)+1
j2 = (j2 mod 10)+1
if k=0 then
ss = ss + mid(pss,j1,1) + mid(pss,j2,1)
else
ss = ss + mid(pss,j2,1) + mid(pss,j1,1)
end if
next
EncodePassword = ss
end function%>
LÀm cách nào để lấy lại pass ?
Bài liên quan
Mình nghĩ là sẽ revert dc.
Anh vui lòng hướng dẫn chi tiết hơn cách encode 1 cái pass mới được ko ?