Исходники и листинги ::: Pascal ::: Генератор паролей

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
  uses crt;
  var ft:text; s,t,r,e:string; ch1,ch2,ch3:char; a,b,c,x,y,i,j,leng,vibor,sch1:integer;
 
  procedure gener;
  begin if a=0  then ch1:='0';
    if a=1  then ch1:='1'; if a=81  then ch1:='?'; 
    if a=2  then ch1:='2'; if a=82  then ch1:=','; 
    if a=3  then ch1:='3'; if a=83  then ch1:='.'; 
    if a=4  then ch1:='4'; if a=84  then ch1:='/'; 
    if a=5  then ch1:='5'; if a=85  then ch1:='?';
    if a=6  then ch1:='6'; if a=86  then ch1:=''; 
    if a=7  then ch1:='7'; if a=87  then ch1:='|'; 
    if a=8  then ch1:='8'; if a=88  then ch1:='`'; 
    if a=9  then ch1:='9'; if a=89  then ch1:='~'; 
    if a=10 then ch1:='a'; if a=90  then ch1:='_'; 
    if a=11 then ch1:='b'; if a=91  then ch1:='-'; 
    if a=12 then ch1:='c'; if a=92  then ch1:='+'; 
    if a=13 then ch1:='d'; if a=93{}then ch1:='='; 
    if a=14 then ch1:='e'; 
    if a=15 then ch1:='f'; 
    if a=16 then ch1:='g'; 
    if a=17 then ch1:='h'; 
    if a=18 then ch1:='i'; 
    if a=19 then ch1:='j'; 
    if a=20 then ch1:='k'; 
    if a=21 then ch1:='l'; 
    if a=22 then ch1:='m'; 
    if a=23 then ch1:='n'; 
    if a=24 then ch1:='o'; 
    if a=25 then ch1:='p'; 
    if a=26 then ch1:='q'; 
    if a=27 then ch1:='r'; 
    if a=28 then ch1:='s'; 
    if a=29 then ch1:='t'; 
    if a=30 then ch1:='u'; 
    if a=31 then ch1:='v'; 
    if a=32 then ch1:='w'; 
    if a=33 then ch1:='x'; 
    if a=34 then ch1:='y'; 
    if a=35 then ch1:='z'; 
    if a=36 then ch1:='A'; 
    if a=37 then ch1:='B'; 
    if a=38 then ch1:='C'; 
    if a=39 then ch1:='D'; 
    if a=40 then ch1:='E'; 
    if a=41 then ch1:='F'; 
    if a=42 then ch1:='G'; 
    if a=43 then ch1:='H'; 
    if a=44 then ch1:='I'; 
    if a=45 then ch1:='J'; 
    if a=46 then ch1:='K'; 
    if a=47 then ch1:='L'; 
    if a=48 then ch1:='M'; 
    if a=49 then ch1:='N'; 
    if a=50 then ch1:='O'; 
    if a=51 then ch1:='P'; 
    if a=52 then ch1:='Q'; 
    if a=53 then ch1:='R'; 
    if a=54 then ch1:='S'; 
    if a=55 then ch1:='T'; 
    if a=56 then ch1:='U'; 
    if a=57 then ch1:='V'; 
    if a=58 then ch1:='W'; 
    if a=59 then ch1:='X'; 
    if a=60 then ch1:='Y'; 
    if a=61 then ch1:='Z'; 
    if a=62 then ch1:='!'; 
    if a=63 then ch1:='@'; 
    if a=64 then ch1:='#'; 
    if a=65 then ch1:='$'; 
    if a=66 then ch1:='%'; 
    if a=67 then ch1:='^'; 
    if a=68 then ch1:='&'; 
    if a=69 then ch1:='*'; 
    if a=70 then ch1:='('; 
    if a=71 then ch1:=')'; 
    if a=72 then ch1:='{'; 
    if a=73 then ch1:='}'; 
    if a=74 then ch1:='['; 
    if a=75 then ch1:=']'; 
    if a=76 then ch1:=':'; 
    if a=77 then ch1:='"'; 
    if a=78 then ch1:=';'; 
  &nbsp;&nbsp;if a=79 then ch1:='<'; 
  &nbsp;&nbsp;if a=80 then ch1:='>';
  end;
 
  begin
  &nbsp;&nbsp;textbackground(7);
  &nbsp;&nbsp;clrscr;
  &nbsp;&nbsp;window(3,3,79,24);
  &nbsp;&nbsp;textbackground(0);
  &nbsp;&nbsp;clrscr;
  &nbsp;&nbsp;window(2,2,78,23);
  &nbsp;&nbsp;textbackground(1);
  &nbsp;&nbsp;clrscr;
  &nbsp;&nbsp;textcolor(3);
  &nbsp;&nbsp;gotoxy(1,1); write('a');
  &nbsp;&nbsp;gotoxy(1,22); write('L');
  &nbsp;&nbsp;gotoxy(77,1); write('¬'); x:=1; y:=1;
  &nbsp;&nbsp;repeat inc(y); gotoxy(x,y); write('¦'); until y>=21; x:=77; y:=1;
  &nbsp;&nbsp;repeat inc(y); gotoxy(x,y); write('¦'); until y>=21; x:=1; y:=1;
  &nbsp;&nbsp;repeat inc(x); gotoxy(x,y); write('='); until x>=76; x:=1; y:=22;
  &nbsp;&nbsp;repeat inc(x); gotoxy(x,y); write('='); until x>=76; gotoxy(76,22); write(''); gotoxy(77,21); write('');
  &nbsp;&nbsp;window(3,3,77,22);
  &nbsp;&nbsp;textbackground(1);
  &nbsp;&nbsp;clrscr;
  &nbsp;&nbsp;textcolor(10);
  &nbsp;&nbsp;randomize;
  &nbsp;&nbsp;writeln('Выберете способ генерации паролей.'); textcolor(14);
  &nbsp;&nbsp;writeln('1)&nbsp;&nbsp;- 0-9');
  &nbsp;&nbsp;writeln('2)&nbsp;&nbsp;- 0-9 + a-z');
  &nbsp;&nbsp;writeln('3)&nbsp;&nbsp;- 0-9 + A-Z');
  &nbsp;&nbsp;writeln('4)&nbsp;&nbsp;- 0-9 + a-z + A-Z');
  &nbsp;&nbsp;writeln('5)&nbsp;&nbsp;- 0-9 + a-z + A-Z + @#$...');
  &nbsp;&nbsp;repeat textcolor(11); readln(vibor); textcolor(14); if (vibor<=0)or(vibor>=11) then begin writeln(''); writeln('Введи правильный вариант... 1-10'); end; until (vibor>0)and(vibor<=10);
  &nbsp;&nbsp;writeln(''); writeln('Введите длинну пароля (1...253)'); e:=' '; b:=0;
  &nbsp;&nbsp;repeat textcolor(11); readln(leng); writeln(''); textcolor(14); if (leng<=0)or(leng>=254) then writeln('Введи правильный вариант... 1-253'); until (leng>0)and(leng<=253);
  &nbsp;&nbsp;repeat inc(b); s:=s+e; until b=leng; i:=0;
  &nbsp;&nbsp;repeat if vibor>=6 then writeln('Введи правильный вариант...'); until vibor<=5;
  &nbsp;&nbsp;&nbsp;&nbsp;if vibor=1 then begin 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat inc(i);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a:=random(10)+0; gener; s[i]:=ch1; until i=leng; textcolor(10); writeln('Ваш пароль...'); writeln(''); textcolor(11); writeln(s); end;
  &nbsp;&nbsp;&nbsp;&nbsp;if vibor=2 then begin 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat inc(i);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a:=random(35)+0; gener; s[i]:=ch1; until i=leng; textcolor(10); writeln('Ваш пароль...'); writeln(''); textcolor(11); writeln(s); end;
  &nbsp;&nbsp;&nbsp;&nbsp;if vibor=3 then begin 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat inc(i);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a:=random(10)+0; gener; ch2:=ch1;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a:=random(33)+36; gener; a:=random(2)+1; if a=1 then
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s[i]:=ch1 else s[i]:=ch2; until i=leng; textcolor(10); writeln('Aao ia?ieu...'); writeln(''); textcolor(11); writeln(s); end;
  &nbsp;&nbsp;&nbsp;&nbsp;if vibor=4 then begin 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat inc(i);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a:=random(61)+0; gener; s[i]:=ch1; until i=leng; textcolor(10); writeln('Ваш пароль...'); writeln(''); textcolor(11); writeln(s); end;
  &nbsp;&nbsp;&nbsp;&nbsp;if vibor=5 then begin 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat inc(i);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a:=random(93)+0; gener; s[i]:=ch1; until i=leng; textcolor(10); writeln('Ваш пароль...'); writeln(''); textcolor(11); writeln(s); end;
  &nbsp;&nbsp;writeln('');
  &nbsp;&nbsp;textcolor(10); writeln('Сохранить в *.txt документе...? (y/n)');
  &nbsp;&nbsp;repeat textcolor(11); readln(ch3); textcolor(14); if (ch3<>'y')and(ch3<>'Y')and(ch3<>'n')and(ch3<>'N') then begin
  &nbsp;&nbsp;textcolor(14); writeln('Введи правильный варинт... (y/n)'); end; until (ch3='y')or(ch3='Y')or(ch3='n')or(ch3='N');
  &nbsp;&nbsp;if (ch3='y')or(ch3='Y') then begin writeln('Введи имя сохраняемого *.txt файла...'); r:='.txt'; textcolor(11);
  &nbsp;&nbsp;repeat readln(t); i:=0; repeat inc(i);
  &nbsp;&nbsp;&nbsp;&nbsp;if (t[i]='a')or(t[i]='l')or(t[i]='w')or(t[i]='G')or(t[i]='Q')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='b')or(t[i]='m')or(t[i]='x')or(t[i]='H')or(t[i]='R')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='c')or(t[i]='n')or(t[i]='y')or(t[i]='I')or(t[i]='S')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='d')or(t[i]='o')or(t[i]='z')or(t[i]='J')or(t[i]='T')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='e')or(t[i]='p')or(t[i]='A')or(t[i]='K')or(t[i]='U')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='f')or(t[i]='q')or(t[i]='B')or(t[i]='L')or(t[i]='V')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='g')or(t[i]='r')or(t[i]='C')or(t[i]='M')or(t[i]='W')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='h')or(t[i]='s')or(t[i]='D')or(t[i]='N')or(t[i]='X')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='i')or(t[i]='t')or(t[i]='E')or(t[i]='O')or(t[i]='Y')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='j')or(t[i]='u')or(t[i]='F')or(t[i]='P')or(t[i]='Z')or
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t[i]='k')or(t[i]='v')or(t[i]=' ') then sch1:=1 else sch1:=0; until i=length(t);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if sch1=0 then begin textcolor(10); writeln('Введите название *.txt документа латинскими буквами'); textcolor(11); end;
  &nbsp;&nbsp;until sch1=1;
  &nbsp;&nbsp;textcolor(14); t:=t+r;
  &nbsp;&nbsp;assign(ft,t); rewrite(ft); writeln(ft); write(ft,s); close(ft); c:=0;
  &nbsp;&nbsp;repeat inc(c);
  &nbsp;&nbsp;&nbsp;&nbsp;gotoxy(2,20); write(''); delay(20);
  &nbsp;&nbsp;&nbsp;&nbsp;gotoxy(2,20); write('|'); delay(20);
  &nbsp;&nbsp;&nbsp;&nbsp;gotoxy(2,20); write('/'); delay(20);
  &nbsp;&nbsp;&nbsp;&nbsp;gotoxy(2,20); write('-'); delay(20);
  &nbsp;&nbsp;until c=20; end; writeln(''); textcolor(10); writeln('Файл ',t,' сохранён...'); textcolor(14); writeln('');
  writeln('Счасливо...!'); delay(1500);
  end.
<<< Предыдущая работа

Вернуться в галерею исходников
Генератор паролей
Автор: GsU.rus
Город: Иркутск
Дата: 24.10.2006  20:43
Комментариев: 4
Просмотров: 293
Оценка: 1 (0|1|0|0|0) [1]

Вернуться на главную
Авторский комментарий к работе: Генирирует пароли по заданнаму параметру: -только цифры -цифры+маленькие латинские -цифры+большие латинские -цифры+маленькие латинские+большие латинские -цифры+маленькие латинские+большие латинские+символы Задаётся длина пароля
Вы не можете оценивать

КОММЕНТАРИИ К РАБОТЕ:
Администратор 1-го ранга (Координатор) Alex_D* ::: комментарий от 01.01.2007 | 20:11
Alex_D Мастер (ур.17)
Очки: 34698
Город: Новосибирск
Тв. работ: 110
Рег: 27.04.2006 (34)
Некоторые символы нельзя использовать в паролях, поэтому в генераторе их лучше исключить.


--------------------
The procedure's completed. Successful system updating... Hey, have a nice day! -x-
mad genius* ::: комментарий от 01.01.2007 | 18:39
  Искатель (ур.5)
Очки: 331
Город: Новгород
Тв. работ: 0
Рег: 31.12.2006 (2028)
Ответ для wolong 10.11.2006 | 20:47:

Эта функция - хрень.
mad genius* ::: комментарий от 01.01.2007 | 18:38
  Искатель (ур.5)
Очки: 331
Город: Новгород
Тв. работ: 0
Рег: 31.12.2006 (2028)
Сразу видно, новичок в этом деле!
wolong ::: комментарий от 10.11.2006 | 20:47
wolong Искатель (ур.5)
Очки: 383
Город: Tomsk
Тв. работ: 1
Рег: 15.06.2006 (280)
афтар видать даже не слышал о такой полезной функции в паскале как chr();


--------------------
$_="1K8}3v3w8(5f1o2q5y6n3h1s5%2R0e9{7s9)5m1b6i2m6k3u";s/(.)(.)/pack('C',ord($2)-$1)/eg;print;