The reverse algorithm of the combination of public passwords _ application techniques

Source: Internet
Author: User



function Decode (avalue:string): String;
Var
Ivalue:array [0..63]of Byte;
I,j,k,ial,icl:byte;
Pass:array[0..15]of Char; Password is no longer than 15 digits
Begin
STR to int
i:=0;
j:=0;
while (1=1) do
Begin
We need to improve here.
J:=pos (", avalue);
If J<=0 Then
Begin
Ivalue[i]:=strtoint (Avalue);
Break
End
Ivalue[i]:=strtoint (Copy (avalue,1,j-1));
Inc (I);
Avalue:=copy (Avalue,j+1,length (avalue)-j);
End

Xor
For i:=63 Downto 1 do
IVALUE[I-1]:=IVALUE[I-1] XOR ivalue[i];

//
For i:=15 Downto 1 do
Begin
Ial:=ivalue[i];
icl:=ial;
Asm
MOV al,ial
SAR al,4
and AL, $F
MOV Ial,al
End The direct use of SHR is also possible, but the disassembly is sar,pascal without SAR.
j:=ial+$30;
IAL:=IVALUE[J];
Icl:=icl and $f;
ICL:=IVALUE[0]+ICL;
K:=ICL;
ICL:=IVALUE[K];
IVALUE[J]:=ICL;
ivalue[k]:=ial;
End

I:=IVALUE[0];
J:=1;
While ivalue[i]<>0 do
Begin
PASS[J-1]:=CHR (Ivalue[i]);
INC (i);
INC (j);
End

Result:=pass;
End

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.