Traduci este algoritmo del vb a delphi.
Es un algoritmo con key alfanumerica.
Encryptar
function Encryptar( text : string; tPass : string) : string;
var
aux , x, iPass : Integer;
begin
for x := 1 to length(tPass) do
iPass := iPass + Ord(tPass[x]);
for x := 1 to length(text) do
begin
aux := Ord(text[x]) + iPass + x;
while (aux > 255) do
aux := aux - 255;
Result := Result + Chr(aux);
end;
end;
Desencryptar
function Desencryptar(text : string; tPass : string) : string;
var
aux , x, iPass : Integer;
begin
for x := 1 to length(tPass) do
iPass := iPass + Ord(tPass[x]);
for x := 1 to length(text) do
begin
aux := Ord(text[x]) - iPass - x;
while (aux < 0) do
aux := aux + 255;
Result := Result + Chr(aux);
end;
end;
(http://i.imgur.com/E31LB.gif)
Saludos
Se agradece mucho :)
Saludos,, Cronos.-
y acepta simbolos en la encriptacion?? o se quedaria como esta el simbolo?? o es solo para letras?
Ola amigo, como faço para usar?
Usei isto e não funcionou:
Memo1.Lines.Text := Encryptar(Edit1.Text);
Pode me ajudar?
Saludos!