iago07 Novato

Registrado: Segunda-Feira, 10 de Novembro de 2014 Mensagens: 2
|
Enviada: Seg Nov 10, 2014 8:46 pm Assunto: Descriptar mensagem no mobile |
|
|
Galera, estou fazendo um encriptador pra mobile, consegui fazer o botão encriptar do meu programa(button1), mas não to conseguindo descriptar(button2) a mensagem depois... alguem pode me ajudar?? isso foi o que eu consegui fazer.
Agradeço a ajuda.
| Código: | Function Encriptar (Texto, senha:string):string;
var
x, y : integer;
novo : string;
begin
for x := 1 to length(senha) do
begin
novo := ' ';
for y := -1 to length(texto) do
novo := novo+ char(ord(senha[x]) xor ord(texto[y]));
Texto:=novo;
end;
result :=texto;
end;
Function descriptar (texto, senha:string):string;
var
x, y:integer;
novo :string;
begin
for x := 1 to length(senha) do
begin
novo:= ' ';
for y := +1 to length(texto) do
novo:=novo+ char(ord(texto[y]) xor ord(senha[x]));
texto:=novo;
end;
result:=texto;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
l : string;
arquivostring: string;
r : string;
begin
l:= edit1.Text;
r := edit2.Text ;
arquivostring := encriptar(l, r);
Edit3.Text := arquivostring;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
l : string;
arquivostring: string;
r : string;
begin
l:= edit1.Text;
r := edit2.Text ;
arquivostring := descriptar(l, r);
Edit3.Text := arquivostring;
end;
end. |
|
|