我使用了这个加密纯文本的简单代码。然后我尝试使用相同的加密方法对其进行解密,但在加密部分进行了反转。有一个乘法过程,我不知道如何在解密代码中反转它。
这是代码:
procedure TForm1.Button1Click(Sender: TObject);
var
s: String;
count, ilength: Integer;
begin
s := edit1.Text;
ilength := Length(s);
FOR count := 1 to ilength do
begin
s[count] := chr(ord(s[count]) * 4 + 1); // Encoding
end;
Label1.caption := s;
// Display encoded text
// Decoding section
// This will probably be placed in another procedure.
FOR count := 1 to ilength do
begin
s[count] := chr(ord((s[count]) / 4) - 1);
// Here I Get An Error ! Please Help Guys, Thanks
end;
end;