• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Delphi Cifrado Autoclave By AX

Status
Not open for further replies.

Expermicid

Leech
User
Joined
Oct 23, 2011
Messages
285
Reputation
0
Reaction score
255
Points
63
Credits
0
‎13 Years of Service‎
95%
[lenguaje=delphi]Function Autoclave(A : String; B : String; C : Integer) : String;

{'================================================================='}

{' AX: Segundo cifrado de Vigenère '}

{' Uso: Autoclave('Texto', 'Clave', 1/2) '}

{' Cifrar (1) | Descifrar (2) '}

{'================================================================='}

Var D : LongInt;

Var E : String;

Var F : Integer;

Var G : Integer;

Var H : String;

Var I : String;

Var K : Integer;

Var L : Integer;

Const T = 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZ';

Begin

If (Length(A) = 0) Or (Length(B) = 0) Then Exit;

If Not (C = 1) Then If Not (C = 2) Then Exit;

L := 1;

A := StringReplace(UpperCase(Trim(A)), ' ', '', [rfReplaceAll]);

B := StringReplace(UpperCase(Trim(B)), ' ', '', [rfReplaceAll]);

If Length(B) < Length(A) Then For D := 1 To Length(A) - Length(B) Do E := E + Copy(A, D, 1);

If (C = 2) Then Begin

For D := 1 To Length(A) Do Begin

F := Pos(Copy(A, D, 1), T) - 1;

G := Pos(Copy(B, L, 1), T) - 1;

If (F - G) < 0 Then K := 27 + (F - G) + 1 Else K := (F - G) Mod 27 + 1;

I := I + Copy(T, Pos(Copy(T, K, 1), T), 1);

H := H + Copy(T, Pos(Copy(T, K, 1), T), 1);

If Length(B) = Length(I) Then Begin B := I; I := ''; L := 0; end;

L := L + 1;

end;

end Else Begin

For D := 1 To Length(A) Do Begin

F := Pos(Copy(A, D, 1), T) - 1;

G := Pos(Copy(B + E, D, 1), T) - 1;

H := H + Copy(T, Pos(Copy(T, (F + G) Mod 27 + 1, 1), T), 1);

end;

end;

Autoclave := H;

End;[/lenguaje]

Autor: AX

Fuente: PitbullSecurity

Saludos

 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top