декабря 6, 2008 17:14 - 4 комментария
Без рубрики → Генератор паролей в Ubuntu
Пароли, как известно, должны быть сложными и длинными. Для тех, кто придумывать пароли сам не любит, существуют программы генераторы. Рассмотрим два приложения.
Gpw — программа для создания произносимых паролей длиной до 99 символов. Для установки программы напишите:
sudo apt-get install gpw
Работать с программой очень просто
gpw [количество паролей] [длина слов]
Открываем терминал и пишем, например:
gpw 5 20
Программа сгенерирует 5 паролей по 20 символов.

Рассмотрим ещё одну программу — pwgen.
Для установки программы напишите:
sudo apt-get install pwgen
Работать с программой, как и с gpw, очень просто
pwgen [количество символов] [количество паролей]
Открываем терминал и пишем:
pwgen 20 5
Программа сгенерирует 5 паролей по 20 символов.

4 комментария
#!/usr/bin/perl -w
# Perl version of mkpw_md5_alpha
# Call this by /usr/bin/perl mkpw_md5_alpha.pl –length=integer \$length, # Password length
“count=i” => \$cnt); # Number of hash feedback-cycles
open(DATE, “date +%Y%m%d |”); $theDate = ; close(DATE);
$adate = int($theDate); # Generate Year-Month-Day variable signature
open(DATE, “date +%H%M%S |”); $theDate = ; close(DATE);
$bdate = int($theDate); # Generate Hour-Min-Sec variable signature
open(DATE, “date +%N |”); $theDate = ; close(DATE);
$cdate = int($theDate); # Generate Nanoseconds variable signature
$xdate = $adate ^ $bdate ^ $cdate; $pdate = pack(”a”, $xdate); # Combinate signatures by xor
open(RNG, “head /dev/urandom |”); $sx=; close(RNG);
$sx = $sx.$pdate; # Get random generator concatenated with signatures combination
while ($cnt > 1) { # Process MD5 feedback cycles
$cnt = $cnt – 1;
$sx = md5($sx);
}
$sx = md5_hex($sx); # Last MD5 cycle
# Get substring from base64 encoded random
open(PWD, “echo $sx | uuencode -m -| sed -n 2p | cut -c3-43 |”); $sx=; close(PWD);
$pass = substr($sx, 1, $length); # Limit password length and print it
printf(”%s\n”, $pass);
Можно улучшить стойкость пароля из предыдущего примера:
#!/usr/bin/perl -w
# Perl version of mkpw_md5_alpha
# Call this by /usr/bin/perl mkpw_md5_alpha.pl [–length=integer \$length, # Password length
“cycles=i” => \$cycles); # Number of hash feedback-cycles
#open(DATE, “date +%Y%m%d |”); $theDate = ; close(DATE);
#$ddate = int($theDate); # Generate Year-Month-Day variable signature
# YY-MM-DD date
$hyear = int(strftime “%y”, localtime);
$hmonth = int(strftime “%m”, localtime);
$hday = int(strftime “%d”, localtime);
$ddate = 365 * $hyear + 30 * $hmonth + $hday; # Pseudo-day normalized date signature
#open(DATE, “date +%H%M%S |”); $theDate = ; close(DATE);
#$bdate = int($theDate); # Generate Hour-Min-Sec variable signature
# HH:MM:SS date
$hhour = int(strftime “%H”, localtime);
$hmin = int(strftime “%M”, localtime);
$hsec = int(strftime “%S”, localtime);
$tdate = 3600 * $hhour + 60 * $hmin + $hsec; # Second normalized time signature
open(DATE, “date +%N |”); $theDate = ; close(DATE);
$nsdate = int($theDate); # Nanosecond normalized time
$xdate = $ddate ^ $tdate ^ $nsdate; # Combinate signatures by xor
$pdate = pack(“a”, $xdate); # Pack signature to a string
open(RNG, “head /dev/urandom |”); $sx=; close(RNG);
$sx = $sx.$pdate; # Get random generator concatenated with signatures combination
while ($cycles > 1) { # Process MD5 feedback cycles
$cycles = $cycles – 1;
$sx = md5($sx);
}
$sx = encode_base64(md5($sx)); # Convert result of last MD5 cycle to Base64
$sx = substr($sx, 0, 16); # Cut control symbols in tail
# Get substring from base64 encoded random
#open(PWD, “echo $sx | uuencode -m -| sed -n 2p | cut -c3-43 |”); $sx=; close(PWD);
printf(“%s\n”, substr($sx, 0, $length)); # Limit password length and print password
#!/usr/bin/perl -w
# Perl version of mkpw_md5_alpha
# Call this by /usr/bin/perl mkpw_md5_alpha.pl [--length=integer \$length, # Password length
"cycles=i" => \$cycles); # Number of hash feedback-cycles
open(RNG, "head /dev/urandom |"); $sx=; close(RNG);
$pdate = hdate();
$sx = $sx.$pdate; # Get random generator concatenated with signatures combination
while ($cycles > 1) { # Process MD5 feedback cycles
$cycles = $cycles - 1;
$sx = md5($sx);
}
$sx = encode_base64(md5($sx)); # Convert result of last MD5 cycle to Base64
$sx = substr($sx, 0, 16); # Cut control symbols in tail
# Get substring from base64 encoded random
#open(PWD, "echo $sx | uuencode -m -| sed -n 2p | cut -c3-43 |"); $sx=; close(PWD);
printf("%s\n", substr($sx, 0, $length)); # Limit password length and print password
sub hdate
{
my ($theDate, $hyear, $hmonth, $hday, $ddate,
$hhour, $hmin, $hsec, %tdate,
$hns, $nsdate, $xdate, $pdate, $sx, $sy, $pass);
# YY-MM-DD date
$hyear = int(strftime "%y", localtime);
$hmonth = int(strftime "%m", localtime);
$hday = int(strftime "%d", localtime);
$ddate = 365 * $hyear + 30 * $hmonth + $hday; # Pseudo-day normalized date signature
# HH:MM:SS date
$hhour = int(strftime "%H", localtime);
$hmin = int(strftime "%M", localtime);
$hsec = int(strftime "%S", localtime);
$tdate = 3600 * $hhour + 60 * $hmin + $hsec; # Second normalized time signature
open(DATE, "date +%N |"); $theDate = ; close(DATE);
$nsdate = int($theDate); # Nanosecond normalized time
$xdate = $ddate ^ $tdate ^ $nsdate; # Combinate signatures by xor
$pdate = pack("a", $xdate); # Pack signature to a string
return $pdate;
}
Оставить комментарий
- Более легкий? Он на mono......
- Огромное спасибо автору за команды, долго я это искал....
- Советую ещё попробовать Docky. Внешне разница не сильная, но Docky более легкий....
- Ну русификация будет 100%
Интересно, сколько стоит академическая лицензия!?...
- А можно как-то портировать "Центр приложений Убунту" из 10.10 в 10.04? Ато ради ...
Внимание! Акция: фишки для покера. Покерные наборы напрокат. . взыскание долга по расписке - все без проблем

#!/bin/bash
# Password generators
# Simple alphabetic password making function
function mkpw() { head /dev/urandom | uuencode -m – | sed -n 2p | cut -c1-${1:-8}; }
function mkpw_md5() { # Hex password making function via MD5 hashing
# random + Year + Month + Day + Hour + Minute + Second + Nanoseconds
local s=$(head /dev/urandom)$(date +%Y%m%d%H%M%S%N)
echo $s | md5sum | cut -c1-${1:-8};
}
function mkpw_md5_alpha() { # Alphabetic password making function via MD5 hashing
# random + Year + Month + Day + Hour + Minute + Second + Nanoseconds
local s=$(head /dev/urandom)$(date +%Y%m%d%H%M%S%N)
echo $s | md5sum | uuencode -m -| sed -n 2p | cut -c3-43 | cut -c1-${1:-8};
}
function mkpw_sha1() { # Hex password making function via SHA1 hashing
# random + Year + Month + Day + Hour + Minute + Second + Nanoseconds
local s=$(head /dev/urandom)$(date +%Y%m%d%H%M%S%N)
echo $s | sha1sum | cut -c1-${1:-8};
}
function mkpw_sha1_alpha() { # Alphabetic password making function via SHA1 hashing
# random + Year + Month + Day + Hour + Minute + Second + Nanoseconds
local s=$(head /dev/urandom)$(date +%Y%m%d%H%M%S%N)
echo $s | sha1sum | uuencode -m -| sed -n 2p | cut -c3-43 | cut -c1-${1:-8};
}