The principle of ASP encryption and decryption is to replace the line feed/carriage return character with the word "lin". As for entering a number between -95~+95, it is to find a manual random number, which can also be used in the decryption process.
Tried it first:
I made a QQ.htm in C: The content inside is my website URL
program code
Use 44 as a random number to encrypt and get encryption.asp
Program code<%
hu=林DDDZ4<86;4Z05林
execute(UnEncode(hu))
function UnEncode(temp)
but=44
for i = 1 to len(temp)
if mid(temp,i,1)<> Lin then
If Asc(Mid(temp, i, 1)) < 32 or Asc(Mid(temp, i, 1)) > 126 Then
a = a & Chr(Asc(Mid(temp, i, 1)))
else
pk=asc(mid(temp,i,1))-but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
a=a&chr(pk)
end if
else
a=a&vbcrlf
end if
next
UnEncode=a
end function
%>
In fact, if you change Linquan in it to my surname Dan, it will have the same function:)
The code program code but=44 inside is the 44 entered earlier.
Upon closer inspection, it turned out that the theory I wanted to close was published in "Hacker X" as early as 2004.
In case the website cannot be opened, I will excerpt the content into this blog~
Now you know, Microsoft's Script Encoder is not safe, so we have to write a program ourselves to pack it.
The execute function of asp is used to execute strings, that is to say, you can write asp statements as strings and then use execute to execute them. For example, this line of code:
execute(response.write(hackerXfiles)), the effect after execution is equivalent to executing response.write(hackerXfiles). here by
Since the stuff in the execute function is a string, you need to double-write it when you encounter quotation marks. Haha, since there is a string in execute, we can get the stuff inside
Come to encryption.
How to encrypt it? Haha, just use the simplest shifting method. Please see the code:
[/color] Program code but=1
cc=replace(nr,vbcrlf,Hu)
for i= 1 to len(cc)
if mid(cc,i,1)<>Hu then
pk=asc(mid(cc,i,1))+but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
temp=temp&chr(pk)
else
temp=temp&Hu
end if
next
temp=replace(temp,,)
response.write(temp)
This code is the circular shift method under asp. The variable but is the number of bits to shift and can be modified. Haha, what do you call a cycle? Because the program will compare characters
ASCII code will be processed when it is greater than 126 or less than 32, so that the range is between 32 and 126. Because this can avoid characters that windows cannot display. this
This is also the reason why the carriage return and line feed characters are replaced from the beginning. Here I wrote a shift encryption asp program xor.asp and attached it, I hope it will be helpful to you.
Then let us take a look at the result of encrypting response.write(hackerXfiles) using the above code: sftqpotf/xsjuf)
#ibdlfsYgjmft#*, hehe, even the gods can’t understand this time^_^
Since it is encrypted, of course it needs to be decrypted. See the decryption code:
Program code function UnEncode(temp)
but=1 'This is the number of bits shifted by the shift method! Note that the modification here is consistent with the one used when encrypting
for i =1 to len(temp)
if mid(temp,i,1)<>Hu then
pk=asc(mid(temp,i,1))-but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
a=a&chr(pk)
else
a=a&vbcrlf
end if
next
UnEncode=a
end function
Haha, now you know how to execute it, just call this decryption function: execute(UnEncode(sftqpotf/xsjuf)#ibdlfsYgjmft#*))