给你一个现成的,不过要赶快给分啊。(原作)
function _StrToPW(S:String):String;
Var
C:String;
I,L:Integer;
Begin
L:=Length(S);
For I:=1 To L Do
Begin
C := C + Char(Ord(Byte(Copy(S,I,1)[1])+StrToInt(Copy(aPW,(I-1)*2+1,2))));
End;
Result:=C;
End;
function _PWToStr(S:String):String;
Var
C:String;
I,L:Integer;
Begin
L:=Length(S);
For I:=1 To L Do
Begin
C := C + Char(Ord(Byte(Copy(S,I,1)[1])-StrToInt(Copy(aPW,(I-1)*2+1,2))));
End;
Result:=C;
End;