我從http://personalsources.com/includes/functions.asp拉了ASP的代碼和它的編碼的所有密碼,RC4,編碼的功能是:如何創建解密功能對於這RC4算法
function rc4(byref thestr, byref thekey)
dim asciiarray(255)
dim keyarray(255)
if isnull(thestr) then exit function
if len(thekey)=0 then exit function
if len(thestr)=0 then thestr=" "
if len(thestr)=0 then exit function
zxlen=len(thekey)
for ipos=0 To 255
keyarray(ipos)=asc(mid(thekey, ((ipos) Mod (zxlen)) + 1, 1))
next
for ipos=0 To 255
asciiarray(ipos)=ipos
next
vpos=0
for ipos=0 To 255
vpos=(vpos + asciiarray(ipos) + keyarray(ipos)) Mod 256
tempa= asciiarray(ipos)
asciiarray(ipos)=asciiarray(vpos)
asciiarray(vpos)=tempa
next
ipos=0
vpos=0
for rcx=1 To len(thestr)
ipos=(ipos + 1) Mod 256
vpos=(vpos + asciiarray(ipos)) Mod 256
tempb=(asciiarray(ipos) + asciiarray(vpos)) Mod 256
tempa=asciiarray(ipos)
asciiarray(ipos)=asciiarray(vpos)
asciiarray(vpos)=tempa
tempc=asciiarray(tempb)
rc4=rc4 & chr(asc(mid(thestr, rcx, 1)) xor tempc)
next
end function
你知道
如果我們的關鍵加密(RC4),所以我們可以很容易地解密密碼,但我不知道這個函數如何加密密碼?這個函數的確切算法是什麼?這是可能寫一個函數來解密這個RC4密碼?
例如,通過此功能的加密密碼是這樣的(和它從來沒有像RC4密碼!!!):
>r²çÅÅ
簡短的回答:rtfm;) – 2012-04-13 08:56:47
感謝特拉維斯,你怎麼找到它? – user1259236 2012-04-13 08:59:21