Página 1 de 1

Cifrado Zara-128

Publicado: 09 Jun 2011, 21:31
por AX

Código: Seleccionar todo

Function Zara(A : Variant; B : Integer): Variant;
{'=============================================================='}
{' Ax: Zara-128                                                 '}
{' Uso: Zara('Texto', 1/2) | Cifrar (1) - Descifrar (2)         '}
{'=============================================================='}

Var C : Integer;
Var D : String;
Begin

If Length(A) = 0 Then Exit;
C := 1;
If Not (B = 1) Then If Not (B = 2) Then Exit;

Case B Of
1: For C := 1 To Length(A) Do Begin D := D + IntToStr(Ord(Copy(A, C, 1)[1]) + 312) + ' '; end;
2: While C <= Length(A) Do Begin D := D + Chr(StrToInt(Copy(A, C, 3)) - 312); Inc(C, 4); end;
end;

Zara := D;
End;
Saludos.

Re: Cifrado Zara-128

Publicado: 10 Jun 2011, 05:49
por wh0!
Falta más información para este post, en que lenguaje, referencias, modo de uso, etc...
Delphi? creería yo

Re: Cifrado Zara-128

Publicado: 10 Jun 2011, 19:13
por Metal_Kingdom
Sí, es Delphi.

El modo de uso viene en los comentarios:

Código: Seleccionar todo

{' Uso: Zara('Texto', 1/2) | Cifrar (1) - Descifrar (2)         '}
Gracias de nuevo AX