library PCrypt;
uses
FastShareMem,
SysUtils,
Classes;
const
list: array [1..62] of string =
( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z' );
list2: array [1..62] of string =
( '1', '2', '3', '4', '5', '6', '7',
'8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' );
function crypt1(s: string): string; stdcall;
var
wert: array of byte;
i, j: integer;
ende: string;
begin
s := s + 'A';
randseed := 4546464;
SetLength( wert, Length( s ) );
ende := '';
for i := 0 to Length( s ) - 1 do
begin
for j := 1 to 62 do
if
( Copy( s, i, 1 ) = list[ j ] )
then
wert[ i ] := j;
ende := ende + IntToStr( wert[ i ] ) + IntToStr( Random( wert[ i ] ) );
end;
for i := 0 to Length( s ) - 1 do
begin
for j := 1 to 62 do
if
( Copy( s, i, 1 ) = list2[ j ] )
then
wert[ i ] := j;
ende := ende + IntToStr( wert[ i ] ) + IntToStr( Random( wert[ i ] ) );
end;
result := ende;
end;
function crypt(s: string): string; stdcall; export;
var
s1, s2: string;
begin
s1 := crypt1( s );
s2 := crypt1( s1 );
result := s2;
end;
{$R *.res}
exports
Crypt;
begin
end.