Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99c6b68aa3 | ||
|
|
1fa1647408 |
8
CHANGES
8
CHANGES
@@ -1,6 +1,8 @@
|
|||||||
apg-2.3.0b
|
apg-2.2.3
|
||||||
Added support for cracklib
|
Fixed version info (-v).
|
||||||
Improved Makefile structure
|
|
||||||
|
apg-2.2.2
|
||||||
|
Fixed permissions for source distribution.
|
||||||
|
|
||||||
apg-2.2.1
|
apg-2.2.1
|
||||||
Changed manpages of apg and apgd.
|
Changed manpages of apg and apgd.
|
||||||
|
|||||||
125
Makefile
125
Makefile
@@ -1,62 +1,3 @@
|
|||||||
##################################################################
|
|
||||||
# Directories
|
|
||||||
# Install dirs
|
|
||||||
INSTALL_PREFIX = /usr/local
|
|
||||||
|
|
||||||
# Full default path is /usr/local/bin
|
|
||||||
APG_BIN_DIR = /bin
|
|
||||||
|
|
||||||
# Full default path is /usr/local/man/man1
|
|
||||||
APG_MAN_DIR = /man/man1
|
|
||||||
|
|
||||||
# Full default path is /usr/local/sbin
|
|
||||||
APGD_BIN_DIR = /sbin
|
|
||||||
|
|
||||||
# Full default path is /usr/local/man/man8
|
|
||||||
APGD_MAN_DIR = /man/man8
|
|
||||||
|
|
||||||
# You should not edit 2 lines below
|
|
||||||
APGBFM_CLIBS = -lm
|
|
||||||
APG_CLIBS = -lm
|
|
||||||
|
|
||||||
##################################################################
|
|
||||||
# Support for crypted passwords
|
|
||||||
# If you do not want to use crypted passwords output then you must
|
|
||||||
# comment the folowing 2 line.
|
|
||||||
#
|
|
||||||
# NOTE#1: You should comment the line 'APG_CLIBS += -lcrypt' for QNX
|
|
||||||
# RTP 6.1.0, OpenBSD 2.8 and for WIN32.
|
|
||||||
#
|
|
||||||
# NOTE#2: If ld (linker) could not find `crypt' library try to
|
|
||||||
# replace line
|
|
||||||
# 'APG_CLIBS += -lcrypt'
|
|
||||||
# with line
|
|
||||||
# 'APG_CLIBS += -lcrypto'
|
|
||||||
# This works on MacOS X
|
|
||||||
#
|
|
||||||
STANDALONE_OPTIONS += -DAPG_USE_CRYPT
|
|
||||||
APG_CLIBS += -lcrypt
|
|
||||||
|
|
||||||
##################################################################
|
|
||||||
# Support for cracklib
|
|
||||||
# NOTE: Cracklib can be found at
|
|
||||||
# http://www.crypticide.org/users/alecm/
|
|
||||||
# If you want to use cracklib for password quality check then you
|
|
||||||
# must uncomment the folowing 4 lines (you must not do this for WIN32)
|
|
||||||
#
|
|
||||||
#CRACKLIB_DICTPATH = "/usr/local/lib/pw_dict"
|
|
||||||
#STANDALONE_OPTIONS += -DAPG_USE_CRACKLIB '-DCRACKLIB_DICTPATH=${CRACKLIB_DICTPATH}' -I/usr/local/include -L/usr/local/lib
|
|
||||||
#CLISERV_OPTIONS += -DAPG_USE_CRACKLIB '-DCRACKLIB_DICTPATH=${CRACKLIB_DICTPATH}' -I/usr/local/include -L/usr/local/lib
|
|
||||||
#APG_CLIBS += -lcrack
|
|
||||||
|
|
||||||
##################################################################
|
|
||||||
# Support for ANSI X9.17/SHA1 PRNG
|
|
||||||
# If you want to use SHA1 for random number genetation then you
|
|
||||||
# must uncomment the folowing 2 lines
|
|
||||||
#
|
|
||||||
#STANDALONE_OPTIONS += -DAPG_USE_SHA
|
|
||||||
#CLISERV_OPTIONS += -DAPG_USE_SHA
|
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# You can modify CC variable if you have compiler other than GCC
|
# You can modify CC variable if you have compiler other than GCC
|
||||||
# But the code was designed and tested with GCC
|
# But the code was designed and tested with GCC
|
||||||
@@ -65,7 +6,44 @@ CC = gcc
|
|||||||
##################################################################
|
##################################################################
|
||||||
# Compilation flags
|
# Compilation flags
|
||||||
# You should comment the line below for AIX+native cc
|
# You should comment the line below for AIX+native cc
|
||||||
CFLAGS = -Wall
|
FLAGS = -Wall
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
# Libraries
|
||||||
|
#
|
||||||
|
# You should comment the line below ('LIBS= -lcrypt')for QNX RTP
|
||||||
|
# 6.1.0, OpenBSD 2.8 and above, WIN32 (+MinGW)
|
||||||
|
LIBS = -lcrypt
|
||||||
|
LIBM = -lm
|
||||||
|
# Use lines below for cygwin
|
||||||
|
# LIBS =
|
||||||
|
# LIBM =
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
# Support for crypted passwords
|
||||||
|
#
|
||||||
|
# DO NOT EDIT THE LINE BELOW !!!
|
||||||
|
CRYPTED_PASS = APG_DONOTUSE_CRYPT
|
||||||
|
# Coment this if you do not want to use crypted passwords output
|
||||||
|
# or trying to build programm for win32
|
||||||
|
CRYPTED_PASS = APG_USE_CRYPT
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
# Support for ANSI X9.17/SHA1 PRNG
|
||||||
|
#
|
||||||
|
# DO NOT EDIT THE LINE BELOW !!!
|
||||||
|
USE_SHA = APG_USE_SHA
|
||||||
|
# Coment this if you want to use PRNG X9.17 with SHA-1
|
||||||
|
USE_SHA = APG_DONOTUSE_SHA
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
# Directories
|
||||||
|
# Install dirs
|
||||||
|
INSTALL_PREFIX = /usr/local
|
||||||
|
APG_BIN_DIR = /bin
|
||||||
|
APG_MAN_DIR = /man/man1
|
||||||
|
APGD_BIN_DIR = /sbin
|
||||||
|
APGD_MAN_DIR = /man/man8
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# If you plan to install APG daemon you should look at lines below #
|
# If you plan to install APG daemon you should look at lines below #
|
||||||
@@ -81,32 +59,21 @@ CFLAGS = -Wall
|
|||||||
# Linux
|
# Linux
|
||||||
#
|
#
|
||||||
# Uncoment line below for LINUX
|
# Uncoment line below for LINUX
|
||||||
#APG_CS_CLIBS += -lnsl
|
#CS_LIBS = -lnsl
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# Solaris
|
# Solaris
|
||||||
#
|
#
|
||||||
# Uncoment line below for Solaris
|
# Uncoment line below for Solaris
|
||||||
#APG_CS_CLIBS += -lnsl -lsocket
|
#CS_LIBS = -lnsl -lsocket
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# QNX RTP 6.1.0
|
# QNX RTP 6.1.0
|
||||||
#
|
#
|
||||||
# Uncoment line below for QNX RTP 6.1.0
|
# Uncoment line below for QNX RTP 6.1.0
|
||||||
#APG_CS_CLIBS += -lsocket
|
#CS_LIBS = -lsocket
|
||||||
|
|
||||||
####################################################################
|
|
||||||
####################################################################
|
|
||||||
# THE FOLOWING IS USED BY DEVELOPER AND YOU PROBABLY DO NOT NEED TO
|
|
||||||
# MODIFY THIS LINE
|
|
||||||
# STANDALONE_OPTIONS += -DAPG_DEBUG
|
|
||||||
|
|
||||||
####################################################################
|
|
||||||
# ======= YOU DO NOT NEED TO MODIFY ANYTHING BELOW THIS LINE =======
|
|
||||||
####################################################################
|
|
||||||
|
|
||||||
APG_CS_CLIBS += ${APG_CLIBS}
|
|
||||||
|
|
||||||
|
# ====== YOU DO NOT NEED TO MODIFY ANYTHING BELOW THIS LINE ======
|
||||||
# Find group ID for user root
|
# Find group ID for user root
|
||||||
FIND_GROUP = `grep '^root:' /etc/passwd | awk -F: '{ print $$4 }'`
|
FIND_GROUP = `grep '^root:' /etc/passwd | awk -F: '{ print $$4 }'`
|
||||||
|
|
||||||
@@ -122,20 +89,20 @@ OBJECTS = rnd.o ./cast/cast.o pronpass.o randpass.o restrict.o apg.o errors.o
|
|||||||
|
|
||||||
standalone: apg apgbfm
|
standalone: apg apgbfm
|
||||||
|
|
||||||
all: standalone cliserv
|
all: cliserv standalone
|
||||||
|
|
||||||
cliserv: apgd apgbfm
|
cliserv: apgd apgbfm
|
||||||
|
|
||||||
cygwin: standalone
|
cygwin: standalone
|
||||||
|
|
||||||
apg:
|
apg:
|
||||||
${CC} ${CFLAGS} ${STANDALONE_OPTIONS} -o ${PROGNAME} ${SOURCES} ${APG_CLIBS}
|
${CC} ${FLAGS} -D${CRYPTED_PASS} -D${USE_SHA} -o ${PROGNAME} ${SOURCES} ${LIBS} ${LIBM}
|
||||||
|
|
||||||
apgd:
|
apgd:
|
||||||
${CC} ${CFLAGS} -DCLISERV ${CLISERV_OPTIONS} -o ${CS_PROGNAME} ${SOURCES} ${APG_CS_CLIBS}
|
${CC} ${FLAGS} -DCLISERV -D${USE_SHA} -o ${CS_PROGNAME} ${SOURCES} ${CS_LIBS} ${LIBM}
|
||||||
|
|
||||||
apgbfm:
|
apgbfm:
|
||||||
${CC} ${FLAGS} -DAPGBFM -o ${BFM_PROGNAME} ${BFM_SOURCES} ${APGBFM_CLIBS}
|
${CC} ${FLAGS} -DAPGBFM -o ${BFM_PROGNAME} ${BFM_SOURCES} ${LIBM}
|
||||||
|
|
||||||
strip:
|
strip:
|
||||||
strip ${PROGNAME}
|
strip ${PROGNAME}
|
||||||
|
|||||||
28
README
28
README
@@ -1,30 +1,14 @@
|
|||||||
APG v2.1.0 was tested and found working on:
|
APG v2.2.0 was tested and found working on:
|
||||||
|
|
||||||
i386 FreeBSD 4.6-RELEASE
|
i386 FreeBSD 5.0-RELEASE
|
||||||
Intel Solaris 8 gcc-2.95.2
|
Intel Solaris 8 gcc-2.95.2
|
||||||
SPARC Solaris 8 gcc-2.95.2
|
QNX PRP 6.0
|
||||||
RedHat Linux 7.2
|
RedHat Linux 7.2
|
||||||
|
Mandrake Linux 9.1
|
||||||
APG v1.2.13 was tested and found working on:
|
Win 2000 Pro
|
||||||
|
|
||||||
i386 FreeBSD 4.0-RELEASE
|
|
||||||
NetBSD (reported by Tomasz Luchowski <zuntum@eik.pl>)
|
|
||||||
OpenBSD (reported by Rick VanNorman <rick@neverslow.com>)
|
|
||||||
i386 Linux-Mandrake 6.0
|
|
||||||
i386 Linux-Redhat 7.0
|
|
||||||
i386 Linux-Mandrake 7.2 (reported by Andrew J. Caird <acaird@advance-inc.com>)
|
|
||||||
Intel Solaris 8 gcc-2.95.2
|
|
||||||
SPARC Solaris 8 gcc-2.95.2
|
|
||||||
Intel Windows 2000+CYGWIN v1.1.4
|
|
||||||
HP-UX 10.20 HP ANSI C Compilier (reported by Alexander J Pierce <apierce@boi.hp.com>)
|
|
||||||
HP-UX 11.00 HP ANSI C Compilier (reported by Alexander J Pierce <apierce@boi.hp.com>)
|
|
||||||
HP-UX 11.00 gcc-2.95.2 (reported by Andrew J. Caird <acaird@advance-inc.com>)
|
|
||||||
IRIX 6.5.8 gcc-2.95.2 (reported by Andrew J. Caird <acaird@advance-inc.com>)
|
|
||||||
AIX 4.3.3+native cc (reported by Philip Le Riche <pleriche@uk03.bull.co.uk>)
|
|
||||||
AIX 4.3.3+gcc (reported by Philip Le Riche <pleriche@uk03.bull.co.uk>)
|
|
||||||
|
|
||||||
NOTE:
|
NOTE:
|
||||||
This release (APG v2.1.0b1) is NOT yet compatible with TkAPG (Tcl/Tk frontend for APG)
|
This release (APG v2.2.0) is NOT compatible with TkAPG (Tcl/Tk frontend for APG)
|
||||||
|
|
||||||
Any compatibility reports are welcome
|
Any compatibility reports are welcome
|
||||||
|
|
||||||
|
|||||||
1
THANKS
1
THANKS
@@ -28,4 +28,3 @@ Bartosz Sobolewski - Worthy <worthy@data.pl>
|
|||||||
James Mancini <jmancini@netreo.net>
|
James Mancini <jmancini@netreo.net>
|
||||||
Arno Wilhelm <a.wilhelm@phion.com>
|
Arno Wilhelm <a.wilhelm@phion.com>
|
||||||
Michael Matthews <mjmatt@qsun.mt.att.com>
|
Michael Matthews <mjmatt@qsun.mt.att.com>
|
||||||
K.-M. Hansche <klaus-martin.hansche@kvberlin.de>
|
|
||||||
|
|||||||
3
TODO
3
TODO
@@ -5,6 +5,9 @@ Priority Hi:
|
|||||||
|
|
||||||
* Fix some code style or other errors if any.
|
* Fix some code style or other errors if any.
|
||||||
|
|
||||||
|
* Make some kind of configuration file to avoid command
|
||||||
|
line parameter typing.
|
||||||
|
|
||||||
Priority Medium:
|
Priority Medium:
|
||||||
|
|
||||||
* Include support for some other random number generation
|
* Include support for some other random number generation
|
||||||
|
|||||||
81
apg.c
81
apg.c
@@ -39,9 +39,9 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifndef APG_USE_SHA
|
#ifndef APG_USE_SHA
|
||||||
#define APG_VERSION "2.3.0b (PRNG: X9.17/CAST)"
|
#define APG_VERSION "2.2.3 (PRNG: X9.17/CAST)"
|
||||||
#else /* APG_USE_SHA */
|
#else /* APG_USE_SHA */
|
||||||
#define APG_VERSION "2.3.0b (PRNG: X9.17/SHA-1)"
|
#define APG_VERSION "2.2.3 (PRNG: X9.17/SHA-1)"
|
||||||
#endif /* APG_USE_SHA */
|
#endif /* APG_USE_SHA */
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
@@ -87,24 +87,6 @@
|
|||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
|
|
||||||
#if !defined(CLISERV)
|
|
||||||
#if !defined(APG_USE_CRYPT) && !defined(APG_USE_CRACKLIB)
|
|
||||||
#define APG_PROGRAMM_OPTIONS "M:E:a:r:b:p:sdc:n:m:x:htvlq"
|
|
||||||
#elif defined(APG_USE_CRYPT) && !defined(APG_USE_CRACKLIB)
|
|
||||||
#define APG_PROGRAMM_OPTIONS "M:E:a:r:b:p:sdc:n:m:x:htvylq"
|
|
||||||
#elif !defined(APG_USE_CRYPT) && defined(APG_USE_CRACKLIB)
|
|
||||||
#define APG_PROGRAMM_OPTIONS "M:E:a:r:b:p:sdc:n:m:x:htvklq"
|
|
||||||
#elif defined(APG_USE_CRYPT) && defined(APG_USE_CRACKLIB)
|
|
||||||
#define APG_PROGRAMM_OPTIONS "M:E:a:r:b:p:sdc:n:m:x:htvyklq"
|
|
||||||
#endif /* CRYPT,CRACKLIB */
|
|
||||||
#else /* CLISERV */
|
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
#define APG_PROGRAMM_OPTIONS "M:E:a:r:b:p:n:m:x:vkt"
|
|
||||||
#else /* CRACKLIB */
|
|
||||||
#define APG_PROGRAMM_OPTIONS "M:E:a:r:b:p:n:m:x:vt"
|
|
||||||
#endif /* CRACKLIB */
|
|
||||||
#endif /* CLUSERV */
|
|
||||||
|
|
||||||
struct pass_m {
|
struct pass_m {
|
||||||
unsigned int pass; /* password generation mode */
|
unsigned int pass; /* password generation mode */
|
||||||
unsigned int filter; /* password generation mode */
|
unsigned int filter; /* password generation mode */
|
||||||
@@ -157,9 +139,6 @@ main (int argc, char *argv[])
|
|||||||
UINT32 user_defined_seed = 0L; /* user defined random seed */
|
UINT32 user_defined_seed = 0L; /* user defined random seed */
|
||||||
int user_defined_seed_present = FALSE; /* user defined random seed flag */
|
int user_defined_seed_present = FALSE; /* user defined random seed flag */
|
||||||
char *str_mode; /* string mode pointer */
|
char *str_mode; /* string mode pointer */
|
||||||
#ifdef APG_USE_CRACKLIB
|
|
||||||
unsigned int cracklib_restrict_present = FALSE;
|
|
||||||
#endif /* APG_USE_CRACKLIB*/
|
|
||||||
#ifndef CLISERV
|
#ifndef CLISERV
|
||||||
char *com_line_seq;
|
char *com_line_seq;
|
||||||
char *spell_pass_string;
|
char *spell_pass_string;
|
||||||
@@ -169,7 +148,6 @@ main (int argc, char *argv[])
|
|||||||
char *crypt_string;
|
char *crypt_string;
|
||||||
unsigned int show_crypt_text = FALSE; /* display crypt(3)'d text flag */
|
unsigned int show_crypt_text = FALSE; /* display crypt(3)'d text flag */
|
||||||
#endif /* APG_USE_CRYPT */
|
#endif /* APG_USE_CRYPT */
|
||||||
|
|
||||||
#endif /* CLISERV */
|
#endif /* CLISERV */
|
||||||
#ifdef CLISERV
|
#ifdef CLISERV
|
||||||
#if defined(sgi) || defined(__APPLE__) || defined(__QNX__) /* Thanks to Andrew J. Caird */
|
#if defined(sgi) || defined(__APPLE__) || defined(__QNX__) /* Thanks to Andrew J. Caird */
|
||||||
@@ -197,14 +175,18 @@ main (int argc, char *argv[])
|
|||||||
syslog (LOG_INFO, "password generation request from %s.%d\n", peer_ip, htons(cliaddr->sin_port));
|
syslog (LOG_INFO, "password generation request from %s.%d\n", peer_ip, htons(cliaddr->sin_port));
|
||||||
#endif /* CLISERV */
|
#endif /* CLISERV */
|
||||||
|
|
||||||
#if defined(APG_DEBUG)
|
|
||||||
fprintf (stdout,"APG_PROGRAMM_OPTIONS--> %s\n\n", APG_PROGRAMM_OPTIONS);
|
|
||||||
fflush (stdout);
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
** Analize options
|
** Analize options
|
||||||
*/
|
*/
|
||||||
while ((option = apg_getopt (argc, argv, APG_PROGRAMM_OPTIONS)) != -1)
|
#ifndef CLISERV
|
||||||
|
#ifdef APG_USE_CRYPT
|
||||||
|
while ((option = apg_getopt (argc, argv, "M:E:a:r:b:p:sdc:n:m:x:htvylq")) != -1)
|
||||||
|
#else /* APG_USE_CRYPT */
|
||||||
|
while ((option = apg_getopt (argc, argv, "M:E:a:r:b:p:sdc:n:m:x:htvlq")) != -1)
|
||||||
|
#endif /* APG_USE_CRYPT */
|
||||||
|
#else /* CLISERV */
|
||||||
|
while ((option = apg_getopt (argc, argv, "M:E:a:r:b:p:n:m:x:vt")) != -1)
|
||||||
|
#endif /* CLISERV */
|
||||||
{
|
{
|
||||||
switch (option)
|
switch (option)
|
||||||
{
|
{
|
||||||
@@ -243,14 +225,6 @@ main (int argc, char *argv[])
|
|||||||
min_substr_len = atoi (apg_optarg);
|
min_substr_len = atoi (apg_optarg);
|
||||||
paranoid_bloom_restrict_present = TRUE;
|
paranoid_bloom_restrict_present = TRUE;
|
||||||
break;
|
break;
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
case 'k': /* cracklib password check */
|
|
||||||
restrictions_present = TRUE;
|
|
||||||
cracklib_restrict_present = TRUE;
|
|
||||||
break;
|
|
||||||
#endif /* CRACKLIB */
|
|
||||||
#endif /* WIN32 */
|
|
||||||
#ifndef CLISERV
|
#ifndef CLISERV
|
||||||
case 'l':
|
case 'l':
|
||||||
spell_present = TRUE;
|
spell_present = TRUE;
|
||||||
@@ -379,18 +353,10 @@ main (int argc, char *argv[])
|
|||||||
restrict_res = paranoid_bloom_check_pass(pass_string, restrictions_file, min_substr_len);
|
restrict_res = paranoid_bloom_check_pass(pass_string, restrictions_file, min_substr_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
/* Cracklib check */
|
|
||||||
if (restrict_res == 0)
|
|
||||||
if(cracklib_restrict_present == TRUE)
|
|
||||||
restrict_res = cracklib_check_pass (pass_string, CRACKLIB_DICTPATH);
|
|
||||||
#endif /* APG_USE_CRACKLIB */
|
|
||||||
#endif /* WIN32 */
|
|
||||||
/* Dictionary check */
|
/* Dictionary check */
|
||||||
if (restrict_res == 0)
|
if (restrict_res == 0)
|
||||||
if (plain_restrictions_present == TRUE)
|
if (plain_restrictions_present == TRUE)
|
||||||
restrict_res = check_pass(pass_string, plain_restrictions_file);
|
restrict_res = check_pass(pass_string, plain_restrictions_file);
|
||||||
|
|
||||||
|
|
||||||
switch (restrict_res)
|
switch (restrict_res)
|
||||||
@@ -498,18 +464,10 @@ main (int argc, char *argv[])
|
|||||||
restrict_res = paranoid_bloom_check_pass(pass_string, restrictions_file, min_substr_len);
|
restrict_res = paranoid_bloom_check_pass(pass_string, restrictions_file, min_substr_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
/* Cracklib check */
|
|
||||||
if (restrict_res == 0)
|
|
||||||
if(cracklib_restrict_present == TRUE)
|
|
||||||
restrict_res = cracklib_check_pass (pass_string, CRACKLIB_DICTPATH);
|
|
||||||
#endif /* APG_USE_CRACKLIB */
|
|
||||||
#endif /* WIN32 */
|
|
||||||
/* Dictionary check */
|
/* Dictionary check */
|
||||||
if (restrict_res == 0)
|
if (restrict_res == 0)
|
||||||
if (plain_restrictions_present == TRUE)
|
if (plain_restrictions_present == TRUE)
|
||||||
restrict_res = check_pass(pass_string, plain_restrictions_file);
|
restrict_res = check_pass(pass_string, plain_restrictions_file);
|
||||||
|
|
||||||
|
|
||||||
switch (restrict_res)
|
switch (restrict_res)
|
||||||
@@ -669,11 +627,6 @@ print_help (void)
|
|||||||
printf ("-b filter_file apply bloom filter check against filter_file\n");
|
printf ("-b filter_file apply bloom filter check against filter_file\n");
|
||||||
printf (" (filter_file should be created with apgbfm(1) utility)\n");
|
printf (" (filter_file should be created with apgbfm(1) utility)\n");
|
||||||
printf ("-p substr_len paranoid modifier for bloom filter check\n");
|
printf ("-p substr_len paranoid modifier for bloom filter check\n");
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
|
||||||
#ifdef APG_USE_CRACKLIB
|
|
||||||
printf ("-k apply cracklib ckeck\n");
|
|
||||||
#endif /* APG_USE_CRYPT */
|
|
||||||
#endif /* WIN32 */
|
|
||||||
printf ("-a algorithm choose algorithm\n");
|
printf ("-a algorithm choose algorithm\n");
|
||||||
printf (" 1 - random password generation according to\n");
|
printf (" 1 - random password generation according to\n");
|
||||||
printf (" password modes\n");
|
printf (" password modes\n");
|
||||||
|
|||||||
2
apgbfm.c
2
apgbfm.c
@@ -35,7 +35,7 @@
|
|||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
|
||||||
|
|
||||||
#define VERSION "2.3.0b"
|
#define VERSION "2.2.3"
|
||||||
|
|
||||||
|
|
||||||
#define FOUND "FOUND"
|
#define FOUND "FOUND"
|
||||||
|
|||||||
2
bloom.h
2
bloom.h
@@ -40,7 +40,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "sha/sha.h"
|
#include "sha/sha.h"
|
||||||
|
|||||||
@@ -31,8 +31,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
|
|
||||||
#ifndef APGBFM
|
#ifndef APGBFM
|
||||||
# include "errs.h"
|
# include "errs.h"
|
||||||
# include "randpass.h"
|
# include "randpass.h"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ apg
|
|||||||
[\fB-n num_of_pass\fP] [\fB-m min_pass_len\fP] [\fB-x max_pass_len\fP]
|
[\fB-n num_of_pass\fP] [\fB-m min_pass_len\fP] [\fB-x max_pass_len\fP]
|
||||||
[\fB-r\fP \fIdictfile\fP] [\fB-b\fP \fIfilter_file\fP] [\fB-p min_substr_len\fP]
|
[\fB-r\fP \fIdictfile\fP] [\fB-b\fP \fIfilter_file\fP] [\fB-p min_substr_len\fP]
|
||||||
[\fB-s\fP] [\fB-c cl_seed\fP] [\fB-d\fP] [\fB-y\fP] [\fB-l\fP] [\fB-t\fP]
|
[\fB-s\fP] [\fB-c cl_seed\fP] [\fB-d\fP] [\fB-y\fP] [\fB-l\fP] [\fB-t\fP]
|
||||||
[\fB-k\fP] [\fB-q\fP] [\fB-h\fP] [\fB-v\fP]
|
[\fB-q\fP] [\fB-h\fP] [\fB-v\fP]
|
||||||
.PP
|
.PP
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B apg
|
.B apg
|
||||||
@@ -189,10 +189,6 @@ that will look like this
|
|||||||
.RE
|
.RE
|
||||||
.SS "Password quality control options"
|
.SS "Password quality control options"
|
||||||
.TP
|
.TP
|
||||||
.B -k
|
|
||||||
check every generated password using \fBcracklib\fP. To use this ability you must
|
|
||||||
enable cracklib support during programm building.
|
|
||||||
.TP
|
|
||||||
.B -r \fIdictfile\fP
|
.B -r \fIdictfile\fP
|
||||||
check generated passwords for their appearance in
|
check generated passwords for their appearance in
|
||||||
.I dictfile
|
.I dictfile
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ apgd
|
|||||||
.B apgd
|
.B apgd
|
||||||
[\fB-a algorithm\fP] [\fB-M mode\fP] [\fB-E char_string\fP]
|
[\fB-a algorithm\fP] [\fB-M mode\fP] [\fB-E char_string\fP]
|
||||||
[\fB-n num_of_pass\fP] [\fB-m min_pass_len\fP] [\fB-x max_pass_len\fP]
|
[\fB-n num_of_pass\fP] [\fB-m min_pass_len\fP] [\fB-x max_pass_len\fP]
|
||||||
[\fB-r\fP \fIdictfile\fP] [\fB-b\fP \fIfilter_file\fP] [\fB-p min_substr_len\fP] [\fB-k\fP]
|
[\fB-r\fP \fIdictfile\fP] [\fB-b\fP \fIfilter_file\fP] [\fB-p min_substr_len\fP]
|
||||||
[\fB-t\fP] [\fB-l\fP]
|
[\fB-t\fP] [\fB-l\fP]
|
||||||
.PP
|
.PP
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@@ -225,10 +225,6 @@ that will look like this
|
|||||||
.RE
|
.RE
|
||||||
.SS "Password quality control options"
|
.SS "Password quality control options"
|
||||||
.TP
|
.TP
|
||||||
.B -k
|
|
||||||
check every generated password using \fBcracklib\fP. To use this ability you must
|
|
||||||
enable cracklib support during programm building.
|
|
||||||
.TP
|
|
||||||
.B -r \fIdictfile\fP
|
.B -r \fIdictfile\fP
|
||||||
check generated passwords for their appearance in
|
check generated passwords for their appearance in
|
||||||
.B dictfile
|
.B dictfile
|
||||||
|
|||||||
388
doc/man/wapg.txt
388
doc/man/wapg.txt
@@ -1,196 +1,192 @@
|
|||||||
WAPG User Manual WAPG
|
WAPG(1) User Manual WAPG(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
apg - generates several random passwords
|
WAPG - generates several random passwords
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
apg [-a algorithm] [-M mode] [-E char_string] [-n num_of_pass] [-m
|
WAPG [-a algorithm] [-M mode] [-E char_string] [-n num_of_pass] [-m
|
||||||
min_pass_len] [-x max_pass_len] [-r dictfile] [-b filter_file] [-p
|
min_pass_len] [-x max_pass_len] [-r dictfile] [-b filter_file] [-p
|
||||||
min_substr_len] [-c cl_seed] [-d] [-l] [-t] [-q] [-h] [-v]
|
min_substr_len] [-c cl_seed] [-d] [-l] [-t] [-q] [-h] [-v]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
apg generates several random passwords. It uses several password gener-
|
WAPG generates several random passwords. It uses several password gener-
|
||||||
ation algorithms (currently two) and a built-in pseudo random number
|
ation algorithms (currently two) and a built-in pseudo random number
|
||||||
generator.
|
generator.
|
||||||
|
|
||||||
Default algorithm is pronounceable password generation algorithm
|
Default algorithm is pronounceable password generation algorithm
|
||||||
designed by Morrie Gasser and described in A Random Word Generator For
|
designed by Morrie Gasser and described in A Random Word Generator For
|
||||||
Pronounceable Passwords National Technical Information Service (NTIS)
|
Pronounceable Passwords National Technical Information Service (NTIS)
|
||||||
AD-A-017676. The original paper is very old and had never been put
|
AD-A-017676. The original paper is very old and had never been put
|
||||||
online, so I have to use NIST implementation described in FIPS-181.
|
online, so I have to use NIST implementation described in FIPS-181.
|
||||||
|
|
||||||
Another algorithm is simple random character generation algorithm, but
|
Another algorithm is simple random character generation algorithm, but
|
||||||
it uses four user-defined symbol sets to produce random password. It
|
it uses four user-defined symbol sets to produce random password. It
|
||||||
means that user can choose type of symbols that should appear in pass-
|
means that user can choose type of symbols that should appear in pass-
|
||||||
word. Symbol sets are: numeric symbol set (0,...,9) , capital letters
|
word. Symbol sets are: numeric symbol set (0,...,9) , capital letters
|
||||||
symbol set (A,...,Z) , small letters symbol set (a,...,z) and special
|
symbol set (A,...,Z) , small letters symbol set (a,...,z) and special
|
||||||
symbols symbol set (#,@,!,...).
|
symbols symbol set (#,@,!,...).
|
||||||
|
|
||||||
Built-in pseudo random number generator is an implementation of algo-
|
Built-in pseudo random number generator is an implementation of algo-
|
||||||
rithm described in Appendix C of ANSI X9.17 or RFC1750 with exception
|
rithm described in Appendix C of ANSI X9.17 or RFC1750 with exception
|
||||||
that it uses CAST or SHA-1 instead of Triple DES. It uses local time
|
that it uses CAST or SHA-1 instead of Triple DES. It uses local time
|
||||||
with precision of microseconds (see gettimeofday(2)) and /dev/random
|
with precision of microseconds (see gettimeofday(2)) and /dev/random
|
||||||
(if available) to produce initial random seed.
|
(if available) to produce initial random seed.
|
||||||
|
|
||||||
apg also have the ability to check generated password quality using
|
WAPG also have the ability to check generated password quality using
|
||||||
dictionary. You can use this ability if you specify command-line
|
dictionary. You can use this ability if you specify command-line
|
||||||
options -r dictfile or -b filtername where dictfile is the dictionary
|
options -r dictfile or -b filtername where dictfile is the dictionary
|
||||||
file name and filtername is the name of Bloom filter file. In that dic-
|
file name and filtername is the name of Bloom filter file. In that dic-
|
||||||
tionary you may place words (one per line) that should not appear as
|
tionary you may place words (one per line) that should not appear as
|
||||||
generated passwords. For example: user names, common words, etc. You
|
generated passwords. For example: user names, common words, etc. You
|
||||||
even can use one of the dictionaries that come with dictionary password
|
even can use one of the dictionaries that come with dictionary password
|
||||||
crackers. Bloom filter file should be created with apgbfm(1) utility
|
crackers. Bloom filter file should be created with WAPGbfm(1) utility
|
||||||
included in apg distribution. In future releases I plan to implement
|
included in WAPG distribution. These checks are case sensitive. For
|
||||||
some other techniques to check passwords (like pattern check) just to
|
example, if you want to reject word 'root', you should insert in dict-
|
||||||
make life easier.
|
file words: root, Root, RoOt, ... , ROOT. It is not the easiest way to
|
||||||
|
check password quality, but it is the most powerful way. In future
|
||||||
|
releases I plan to implement some other techniques to check passwords
|
||||||
OPTIONS
|
(like pattern check) just to make life easier.
|
||||||
Password generation modes options
|
|
||||||
-a algorithm
|
|
||||||
use algorithm for password generation.
|
OPTIONS
|
||||||
0 - (default) pronounceable password generation
|
-M mode
|
||||||
1 - random character password generation
|
Use symbolsets specified with mode for password generation.
|
||||||
|
mode is a text string consisting of characters S, s, N, n, C, c,
|
||||||
-n num_of_pass
|
L, l. Where:
|
||||||
generate num_of_pass number of passwords. Default is 6.
|
|
||||||
|
S generator must use special symbol set for every generated
|
||||||
-m min_pass_len
|
password.
|
||||||
generate password with minimum length min_pass_len. If
|
|
||||||
min_pass_len > max_pass_len then max_pass_len = min_pass_len.
|
s generator should use special symbol set for password gen-
|
||||||
Default minimum password length is 8.
|
eration.
|
||||||
|
|
||||||
-x max_pass_len
|
N generator must use numeral symbol set for every generated
|
||||||
generate password with maximum length max_pass_len. If
|
password.
|
||||||
min_pass_len > max_pass_len then max_pass_len = min_pass_len.
|
|
||||||
Default maximum password length is 10.
|
n generator should use numeral symbol set for password gen-
|
||||||
|
eration.
|
||||||
-M mode
|
|
||||||
Use symbolsets specified with mode for password generation.
|
C generator must use capital symbol set for every generated
|
||||||
mode is a text string consisting of characters S, s, N, n, C, c,
|
password.
|
||||||
L, l. Where:
|
|
||||||
|
c generator should use capital symbol set for password gen-
|
||||||
S generator must use special symbol set for every generated
|
eration.
|
||||||
password.
|
|
||||||
|
L generator must use small letters symbol set for every
|
||||||
s generator should use special symbol set for password gen-
|
generated password (always present if pronounceable pass-
|
||||||
eration.
|
word generation algorithm is used).
|
||||||
|
|
||||||
N generator must use numeral symbol set for every generated
|
l generator should use small letters symbol set for pass-
|
||||||
password.
|
word generation.
|
||||||
|
|
||||||
n generator should use numeral symbol set for password gen-
|
R,r not supported any more. Use -E char_string option
|
||||||
eration.
|
instead.
|
||||||
|
mode can not be more than 4 characters in length.
|
||||||
C generator must use capital symbol set for every generated
|
|
||||||
password.
|
Note:
|
||||||
|
Usage of L, M, N, C will slow down password generation process.
|
||||||
c generator should use capital symbol set for password gen-
|
|
||||||
eration.
|
Examples:
|
||||||
|
-M sncl or -M SNCL or -M Cn
|
||||||
L generator must use small letters symbol set for every
|
|
||||||
generated password (always present if pronounceable pass-
|
-a algorithm
|
||||||
word generation algorithm is used).
|
use algorithm for password generation.
|
||||||
|
0 - (default) pronounceable password generation
|
||||||
l generator should use small letters symbol set for pass-
|
1 - random character password generation
|
||||||
word generation.
|
|
||||||
|
-E char_string
|
||||||
R,r not supported any more. Use -E char_string option
|
exclude characters in char_string from password generation pro-
|
||||||
instead.
|
cess (in pronounceable password generation mode you can not
|
||||||
mode can not be more than 4 characters in length.
|
exclude small letters). To include special symbols that can be
|
||||||
|
recognized by shell (apostrophe, quotes, dollar sign, etc.) in
|
||||||
Note:
|
char_string use the backslashed versions.
|
||||||
Usage of L, M, N, C will slow down password generation process.
|
|
||||||
|
Examples:
|
||||||
Examples:
|
|
||||||
-M sncl or -M SNCL or -M Cn
|
Command WAPG -a 1 -M n -n 3 -m 8 -e 23456789 will generate a set
|
||||||
|
of passwords that will look like this
|
||||||
-E char_string
|
10100110
|
||||||
exclude characters in char_string from password generation pro-
|
01111000
|
||||||
cess (in pronounceable password generation mode you can not
|
11011101
|
||||||
exclude small letters). To include special symbols that can be
|
|
||||||
recognized by shell (apostrophe, quotes, dollar sign, etc.) in
|
Command WAPG -a 1 -M nc -n 3 -m 26 -e GHIJKLMNOPQRSTUVWXYZ will
|
||||||
char_string use the backslashed versions.
|
generate a set of passwords that will look like this
|
||||||
|
16A1653CD4DE5E7BD9584A3476
|
||||||
Examples:
|
C8F78E06944AFD57FB9CB882BC
|
||||||
|
8C8DF37CD792D36D056BBD5002
|
||||||
Command apg -a 1 -M n -n 3 -m 8 -E 23456789 will generate a set
|
|
||||||
of passwords that will look like this
|
-r dictfile
|
||||||
10100110
|
check generated passwords for their appearance in dictfile
|
||||||
01111000
|
|
||||||
11011101
|
-b filter_file
|
||||||
|
check generated passwords for their appearance in filter_file.
|
||||||
Command apg -a 1 -M nc -n 3 -m 26 -E GHIJKLMNOPQRSTUVWXYZ will
|
filter_file should be created with WAPGBFM utility.
|
||||||
generate a set of passwords that will look like this
|
|
||||||
16A1653CD4DE5E7BD9584A3476
|
-p min_substr_len
|
||||||
C8F78E06944AFD57FB9CB882BC
|
this option tells WAPG to check every substring of the gener-
|
||||||
8C8DF37CD792D36D056BBD5002
|
ated password for appearance in filter_file. If any of such sub-
|
||||||
|
strings would be found in the filter_file then generated
|
||||||
Password quality control options
|
password would be rejected and WAPG will generate another one.
|
||||||
-r dictfile
|
min_substr_len specifies minimum substring length to check.
|
||||||
check generated passwords for their appearance in dictfile
|
This option is active only if -b option is defined.
|
||||||
|
|
||||||
-b filter_file
|
-c cl_seed
|
||||||
check generated passwords for their appearance in filter_file.
|
use cl_seed as a random seed for password generation. I use it
|
||||||
filter_file should be created with apgbfm(1) utility.
|
when i have to generate passwords in a shell script.
|
||||||
|
|
||||||
-p min_substr_len
|
-d do NOT use any delimiters between generated passwords. I use it
|
||||||
this option tells apg(1) to check every substring of the gener-
|
when i have to generate passwords in a shell script.
|
||||||
ated password for appearance in filter_file. If any of such sub-
|
|
||||||
strings would be found in the filter_file then generated pass-
|
-n num_of_pass
|
||||||
word would be rejected and apg(1) will generate another one.
|
generate num_of_pass number of passwords. Default is 6.
|
||||||
min_substr_len specifies minimum substring length to check.
|
|
||||||
This option is active only if -b option is defined.
|
-m min_pass_len
|
||||||
|
generate password with minimum length min_pass_len. If
|
||||||
Pseudo random number generator options
|
min_pass_len > max_pass_len then max_pass_len = min_pass_len.
|
||||||
-c cl_seed
|
Default minimum password length is 8.
|
||||||
use cl_seed as a random seed for password generation. I use it
|
|
||||||
when i have to generate passwords in a shell script.
|
-x max_pass_len
|
||||||
|
generate password with maximum length max_pass_len. If
|
||||||
Password output options
|
min_pass_len > max_pass_len then max_pass_len = min_pass_len.
|
||||||
-d do NOT use any delimiters between generated passwords. I use it
|
Default maximum password length is 10.
|
||||||
when i have to generate passwords in a shell script.
|
|
||||||
|
-q quiet mode (do not print warnings)
|
||||||
-q quiet mode (do not print warnings)
|
|
||||||
|
-l spell genetated passwords. Useful when you want to read gener-
|
||||||
-l spell genetated passwords. Useful when you want to read gener-
|
ated password by telephone.
|
||||||
ated password by telephone.
|
WARNING: Think twice before read your password by phone.
|
||||||
WARNING: Think twice before read your password by phone.
|
|
||||||
|
-t print pronunciation for generated pronounceable password
|
||||||
-t print pronunciation for generated pronounceable password
|
|
||||||
|
-h print help information and exit
|
||||||
-h print help information and exit
|
|
||||||
|
-v print version information and exit
|
||||||
-v print version information and exit
|
|
||||||
|
DEFAULT OPTIONS
|
||||||
DEFAULT OPTIONS
|
WAPG -a 0 -M sncl -n 6 -x 10 -m 8 (new style)
|
||||||
apg -a 0 -M sncl -n 6 -x 10 -m 8 (new style)
|
|
||||||
|
EXIT CODE
|
||||||
If you want to generate really secure passwords, you should use option
|
On successful completion of its task, WAPG will complete with exit code
|
||||||
-s.
|
0. An exit code of -1 indicates an error occurred. Textual errors are
|
||||||
|
written to the standard error stream.
|
||||||
EXIT CODE
|
|
||||||
On successful completion of its task, apg will complete with exit code
|
FILES
|
||||||
0. An exit code of -1 indicates an error occurred. Textual errors are
|
None.
|
||||||
written to the standard error stream.
|
|
||||||
|
BUGS
|
||||||
FILES
|
None. If you've found one, please send bug description to the author.
|
||||||
None.
|
|
||||||
|
SEE ALSO
|
||||||
BUGS
|
WAPGBFM.TXT
|
||||||
None. If you've found one, please send bug description to the author.
|
|
||||||
|
AUTHOR
|
||||||
SEE ALSO
|
Adel I. Mirzazhanov, <a-del@iname.com>
|
||||||
wapgbfm.txt
|
Project home page: http://www.adel.nursat.kz/WAPG/
|
||||||
|
|
||||||
AUTHOR
|
|
||||||
Adel I. Mirzazhanov, <a-del@iname.com>
|
|
||||||
Project home page: http://www.adel.nursat.kz/apg/
|
Automated Password Generator 2003 Jun 19 WAPG(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Automated Password Generator 2003 Aug 04 WAPG
|
|
||||||
@@ -1,118 +1,116 @@
|
|||||||
APGBFM(1) User Manual APGBFM(1)
|
WAPGBFM User Manual WAPGBFM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
apgbfm - APG Bloom filter management program
|
WAPGBFM - APG Bloom filter management program
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
apgbfm -f filter -n numofwords [-q] [-s]
|
WAPGBFM -f filter -n numofwords [-q] [-s]
|
||||||
apgbfm -f filter -d dictfile [-q] [-s]
|
WAPGBFM -f filter -d dictfile [-q] [-s]
|
||||||
apgbfm -f filter -a word [-q]
|
WAPGBFM -f filter -a word [-q]
|
||||||
apgbfm -f filter -A dictfile [-q]
|
WAPGBFM -f filter -A dictfile [-q]
|
||||||
apgbfm -f filter -c word [-q]
|
WAPGBFM -f filter -c word [-q]
|
||||||
apgbfm -f filter -C dictfile [-q]
|
WAPGBFM -f filter -C dictfile [-q]
|
||||||
apgbfm -i filter
|
WAPGBFM -i filter
|
||||||
apgbfm [-v] [-h]
|
WAPGBFM [-v] [-h]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
apgbfm is used to manage Bloom filter that is used to restrict password
|
WAPGBFM is used to manage Bloom filter that is used to restrict password
|
||||||
generation in APG pasword generation software. Usage of the Bloom fil-
|
generation in WAPG pasword generation software. Usage of the Bloom fil-
|
||||||
ter allows to speed up password check for large dictionaries and has
|
ter allows to speed up password check for large dictionaries and has
|
||||||
some other benefits.
|
some other benefits.
|
||||||
|
|
||||||
The idea to use Bloom filter for that purpose is came from the descrip-
|
The idea to use Bloom filter for that purpose is came from the descrip-
|
||||||
tion of the OPUS project OPUS: Preventing Weak Password Choices Purdue
|
tion of the OPUS project OPUS: Preventing Weak Password Choices Purdue
|
||||||
Technical Report CSD-TR 92-028 writen by Eugene H. Spafford.
|
Technical Report CSD-TR 92-028 writen by Eugene H. Spafford.
|
||||||
|
|
||||||
You can obtain this article from:
|
You can obtain this article from:
|
||||||
http://www.cerias.purdue.edu/homes/spaf/tech-reps/9128.ps
|
http://www.cerias.purdue.edu/homes/spaf/tech-reps/9128.ps
|
||||||
It has very nice description of Bloom filter and it's advantages for
|
It has very nice description of Bloom filter and it's advantages for
|
||||||
password checking systems.
|
password checking systems.
|
||||||
|
|
||||||
In simple words, apgbfm generates n hash values for every word and sets
|
In simple words, WAPGBFM generates n hash values for every word and sets
|
||||||
corresponding bits in filter file to 1. To check the word apgbfm gener-
|
corresponding bits in filter file to 1. To check the word WAPGBFM gener-
|
||||||
ates the same hash functions for that word and if all n corresponding
|
ates the same hash functions for that word and if all n corresponding
|
||||||
bits in filter file are set to 1 then it suppose that word exists in
|
bits in filter file are set to 1 then it suppose that word exists in
|
||||||
dicionary. apgbfm uses SHA-1 as a hash function.
|
dicionary. WAPGBFM uses SHA-1 as a hash function.
|
||||||
|
|
||||||
apgbfm can be used as standalone utility, not only with apg, or apgd.
|
WAPGBFM can be used as standalone utility, not only with apg, or apgd.
|
||||||
|
|
||||||
|
|
||||||
WARNING !!!
|
WARNING !!!
|
||||||
Filter file format can be changed in the future. I'll try to
|
Filter file format can be changed in the future. I'll try to
|
||||||
make file formats compatible but i can not guaranty this.
|
make file formats compatible but i can not guaranty this.
|
||||||
|
|
||||||
WARNING !!!
|
WARNING !!!
|
||||||
apgbfm may slow down your computer during filter creation.
|
WAPGBFM may slow down your computer during filter creation.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-f filter
|
-f filter
|
||||||
use filter as the name for Bloom filter filename.
|
use filter as the name for Bloom filter filename.
|
||||||
|
|
||||||
-i filter
|
-i filter
|
||||||
print information about filter.
|
print information about filter.
|
||||||
|
|
||||||
-n numofwords
|
-n numofwords
|
||||||
create new empty filter for numofwords number of words. Useful
|
create new empty filter for numofwords number of words. Useful
|
||||||
when you want to fill filter dynamicaly.
|
when you want to fill filter dynamicaly.
|
||||||
|
|
||||||
-d dictfile
|
-d dictfile
|
||||||
create new filter from dictfile. It may take a lot of time to
|
create new filter from dictfile. It may take a lot of time to
|
||||||
generate filter from a big dictionary. In that dictionary you
|
generate filter from a big dictionary. In that dictionary you
|
||||||
may place words (one per line) that should not appear as gener-
|
may place words (one per line) that should not appear as gener-
|
||||||
ated passwords. For example: user names common words, etc. You
|
ated passwords. For example: user names common words, etc. You
|
||||||
even can use one of the dictionaries that come with dictionary
|
even can use one of the dictionaries that come with dictionary
|
||||||
password crackers. This check is case sensitive. For example,
|
password crackers. This check is case sensitive. For example,
|
||||||
if you want to reject word 'root', you should insert in dictfile
|
if you want to reject word 'root', you should insert in dictfile
|
||||||
words: root, Root, RoOt, ... , ROOT. To indicate that program
|
words: root, Root, RoOt, ... , ROOT. To indicate that program
|
||||||
is working apgbfm prints dot for every 100 words added in dic-
|
is working WAPGBFM prints dot for every 100 words added in dic-
|
||||||
tionary.
|
tionary.
|
||||||
|
|
||||||
-a word
|
-a word
|
||||||
add word to the filter.
|
add word to the filter.
|
||||||
|
|
||||||
-A dictfile
|
-A dictfile
|
||||||
add all words from dictfile to the filter. To indicate that pro-
|
add all words from dictfile to the filter. To indicate that pro-
|
||||||
gram is working apgbfm prints dot for every 100 words added in
|
gram is working WAPGBFM prints dot for every 100 words added in
|
||||||
dictionary.
|
dictionary.
|
||||||
|
|
||||||
-c word
|
-c word
|
||||||
check word for appearance in the filter.
|
check word for appearance in the filter.
|
||||||
|
|
||||||
-C dictfile
|
-C dictfile
|
||||||
check every word from dictfile for appearance in the filter.
|
check every word from dictfile for appearance in the filter.
|
||||||
|
|
||||||
-q quiet mode.
|
-q quiet mode.
|
||||||
|
|
||||||
-s create new filter in case-insensitive mode.
|
-s create new filter in case-insensitive mode.
|
||||||
|
|
||||||
-v print version information.
|
-v print version information.
|
||||||
|
|
||||||
-h print help information.
|
-h print help information.
|
||||||
|
|
||||||
EXIT CODE
|
EXIT CODE
|
||||||
On successful completion of its task, apgbfm will complete with exit
|
On successful completion of its task, WAPGBFM will complete with exit
|
||||||
code 0. An exit code of -1 indicates an error occurred. Textual
|
code 0. An exit code of -1 indicates an error occurred. Textual
|
||||||
errors are written to the standard error stream.
|
errors are written to the standard error stream.
|
||||||
|
|
||||||
FILES
|
FILES
|
||||||
None.
|
None.
|
||||||
|
|
||||||
BUGS
|
BUGS
|
||||||
None. If you've found one, please send bug description to the author.
|
None. If you've found one, please send bug description to the author.
|
||||||
|
|
||||||
This man page is Alpha too.
|
SEE ALSO
|
||||||
|
WAPG.TXT
|
||||||
SEE ALSO
|
|
||||||
apgd(8), apg(1)
|
AUTHOR
|
||||||
|
Adel I. Mirzazhanov, <a-del@iname.com>
|
||||||
AUTHOR
|
Project home page: http://www.adel.nursat.kz/apg/
|
||||||
Adel I. Mirzazhanov, <a-del@iname.com>
|
|
||||||
Project home page: http://www.adel.nursat.kz/apg/
|
|
||||||
|
|
||||||
|
Automated Password Generator 2003 Jun 19 WAPGBFM
|
||||||
|
|
||||||
Automated Password Generator 2003 Jun 19 APGBFM(1)
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "pronpass.h"
|
#include "pronpass.h"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "randpass.h"
|
#include "randpass.h"
|
||||||
|
|
||||||
|
|||||||
32
restrict.c
32
restrict.c
@@ -184,38 +184,6 @@ paranoid_bloom_check_pass (char * password, char *filter, USHORT s_len)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
/*
|
|
||||||
** cracklib_check_pass() - check password against cracklib.
|
|
||||||
** INPUT:
|
|
||||||
** char * - password to check.
|
|
||||||
** char * - cracklib dict.
|
|
||||||
** OUTPUT:
|
|
||||||
** int
|
|
||||||
** -1 - error
|
|
||||||
** 1 - password does not pass this check
|
|
||||||
** 0 - password does pass this check
|
|
||||||
** NOTES:
|
|
||||||
** none.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
cracklib_check_pass(char *pw, char *dictpath)
|
|
||||||
{
|
|
||||||
char * msg;
|
|
||||||
msg = FascistCheck(pw,dictpath);
|
|
||||||
if (msg == NULL) return (0);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef APG_DEBUG
|
|
||||||
fprintf(stdout,"cracklib_check_pass: password --> %s rejected (%s)\n", pw, msg);
|
|
||||||
fflush(stdout);
|
|
||||||
#endif
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** filter_check_pass() - routine that checks password against filter string
|
** filter_check_pass() - routine that checks password against filter string
|
||||||
**
|
**
|
||||||
|
|||||||
@@ -33,21 +33,13 @@
|
|||||||
#ifndef APG_RESTRICT_H
|
#ifndef APG_RESTRICT_H
|
||||||
#define APG_RESTRICT_H 1
|
#define APG_RESTRICT_H 1
|
||||||
|
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
#include <packer.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "bloom.h"
|
#include "bloom.h"
|
||||||
#include "randpass.h"
|
#include "randpass.h"
|
||||||
|
|
||||||
#define MAX_DICT_STRING_SIZE 255
|
#define MAX_DICT_STRING_SIZE 255
|
||||||
int check_pass(char * pass, char *dict);
|
int check_pass(char * pass, char *dict);
|
||||||
int bloom_check_pass (char *word, char *filter);
|
int bloom_check_pass (char *word, char *filter);
|
||||||
int paranoid_bloom_check_pass (char * password, char *filter, USHORT s_len);
|
int paranoid_bloom_check_pass (char * password, char *filter, USHORT s_len);
|
||||||
int filter_check_pass(const char * word, unsigned int cond);
|
int filter_check_pass(const char * word, unsigned int cond);
|
||||||
int set_exclude_list(const char * char_string);
|
int set_exclude_list(const char * char_string);
|
||||||
#if defined(APG_USE_CRACKLIB)
|
|
||||||
int cracklib_check_pass(char *pw, char *dictpath);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* APG_RESTRICT_H */
|
#endif /* APG_RESTRICT_H */
|
||||||
|
|||||||
11
rnd.c
11
rnd.c
@@ -31,7 +31,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -130,11 +130,7 @@ u8 ro_key[16] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
|||||||
UINT32
|
UINT32
|
||||||
x917sha1_rnd (void)
|
x917sha1_rnd (void)
|
||||||
{
|
{
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
|
||||||
struct timeval local_time;
|
struct timeval local_time;
|
||||||
#else
|
|
||||||
clock_t local_time[2]; /* clock ticks for win32 */
|
|
||||||
#endif
|
|
||||||
UINT32 I[2] = {0L,0L};
|
UINT32 I[2] = {0L,0L};
|
||||||
UINT32 I_plus_s[2] = {0L,0L};
|
UINT32 I_plus_s[2] = {0L,0L};
|
||||||
UINT32 Xi[2] = {0L,0L};
|
UINT32 Xi[2] = {0L,0L};
|
||||||
@@ -143,12 +139,7 @@ x917sha1_rnd (void)
|
|||||||
BYTE hash [SHA_DIGESTSIZE];
|
BYTE hash [SHA_DIGESTSIZE];
|
||||||
apg_SHA_INFO shaInfo;
|
apg_SHA_INFO shaInfo;
|
||||||
|
|
||||||
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32) && !defined(__WIN32__)
|
|
||||||
(void) gettimeofday (&local_time, 0);
|
(void) gettimeofday (&local_time, 0);
|
||||||
#else
|
|
||||||
local_time[0] = clock();
|
|
||||||
local_time[1] = clock();
|
|
||||||
#endif
|
|
||||||
apg_shaInit ( &shaInfo );
|
apg_shaInit ( &shaInfo );
|
||||||
apg_shaUpdate ( &shaInfo, (BYTE *)&local_time, 8);
|
apg_shaUpdate ( &shaInfo, (BYTE *)&local_time, 8);
|
||||||
apg_shaFinal ( &shaInfo, hash );
|
apg_shaFinal ( &shaInfo, hash );
|
||||||
|
|||||||
Reference in New Issue
Block a user