function RandomPassword(PLen: Integer): string;
var
str: string;
begin
Randomize;
str := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
Result := '';
repeat
Result := Result + str[Random(Length(str)) + 1];
until (Length(Result) = PLen)
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption := RandomPassword(10);
end;
function RandomWord(dictSize, lngStepSize, wordLen, minWordLen: Integer): string;
begin
Result := '';
if (wordLen < minWordLen) and (minWordLen > 0) then
wordLen := minWordLen
else if (wordLen < 1) and (minWordLen < 1) then wordLen := 1;
repeat
Result := Result + Chr(Random(dictSize) + lngStepSize);
until (Length(Result) = wordLen);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Caption := RandomWord(33, 54, Random(12), 2);
end;