Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

encriptador-delphi

Aplicativo para codificar e decodificar uma mensagem baseado em uma chave.

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

CodificadorDelphi

##José Henrique Luckmann Aplicativo para codificar e decodificar uma mensagem baseado em uma chave.

#Funções

pascal
Function Criptografa(Texto: string; chave : integer): string;
var Tamanho,i : integer;
    PalavraHex : String;
begin
  Tamanho := Length(Texto);
  for i := 1 to Tamanho do
    PalavraHex := CHR(chave + Ord(Texto[i]));

  Result := PalavraHex;
end;
pascal
Function Descriptografa(Texto: string; chave : integer): string;
var Tamanho,i : integer;
    PalavraHex : String;
begin
  Tamanho := Length(Texto);
  for i := 1 to Tamanho do
    PalavraHex := CHR(Ord(Texto[i]) - chave);

  Result := PalavraHex;
end;