Sponsored Content
Special Forums Cybersecurity swordfish --- a password generator Post 302507014 by Perderabo on Tuesday 22nd of March 2011 02:18:42 PM
Old 03-22-2011
Quote:
Originally Posted by ArcAngel
Hi,

I use your tool on Solaris 10, only i get this error.

[machine:user]$ ./swordfish
>>}###@>---- format +s +x 10
./swordfish[39]: !X0 && !X1 && !X2 && !X3 && !X4 && !Carry : bad number
password statistics are on
password expansions are on
10 passwords will be generated per template

Opps! Sorry ArcAngel, I had not noticed your report before. Better late than never I guess. Smilie There is no X4, it only goes up to X3. The fix was to remove "!X4 && " from that line. Actually, it's odd that the script ran everywhere else.

I have recently been ordered to use 12 character randomly generated passwords that meet strong complexity requirements. That is why I have dusted off this old script. I need it badly right now. Ironically, I want to to run on Solaris just like ArcAngel. I also tested it on RedHat and it broke on the latest ksh. I had to change my character slicing technique to get it work. I used to do stuff like this:
Code:
first=${x%${x#?}}

to get the first character. That breaks depening on the contents of the field. That had always been the case but it breaks more easily with today's ksh. I switched to
Code:
        first=$x
        while ((${#first} > 1 )) ; do
               first=${first%?}
        done

which works all the time and it much faster than it looks. I upgraded the help system a little, corrected spelling errors, etc. I had to reverse engineer my own code so I upgraded the comments quite a bit as well. It saved me from needed to memorize a string of garbage from a lesser password generator. I hope others can use it as well.
This User Gave Thanks to Perderabo For This Post:
 

7 More Discussions You Might Find Interesting

1. Cybersecurity

Password Generator

I need a great Password Generator program. I looked at a few of them, but none of them seemed to be what I wanted. So I have decided to write my own. (That's the cool thing about being a programmer....I always get what I want in software :) ) Do you have any password generators that you... (13 Replies)
Discussion started by: Perderabo
13 Replies

2. UNIX for Dummies Questions & Answers

date generator

Is there a command to generate the unix date that is in theshadow file?>? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

3. Shell Programming and Scripting

time generator

Hi experts, I'd like to generate the table/file containing: number of milliseconds elapsed since midnight till midnight. It should contain 5 columns (hours minutes seconds milliseconds): Table will have theoretically 86 400 000 rows. My question is , is there somewhere the file or source... (7 Replies)
Discussion started by: hernand
7 Replies

4. Shell Programming and Scripting

Sequence generator

Thanks Guys This really helped (5 Replies)
Discussion started by: robert89
5 Replies

5. UNIX for Beginners Questions & Answers

Password generator with user inputs

Hi, I am new to bash scripting and i wanted to make a bash script that will generate a password for a user. The user must enter his/her name and the url of the site the password is used for. And the script will generate a password with those two elements in the password. So if the url is... (0 Replies)
Discussion started by: Kvr123
0 Replies

6. Shell Programming and Scripting

Random Password generator with 2 digits and 6 characters

I am using the below to random generate a password but I need to have 2 numeric characters and 6 alphabetic chars head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '' 6USUvqRB ------ Post updated at 04:43 PM ------ Any Help folks - Can the output be passed onto a sed command to... (9 Replies)
Discussion started by: infernalhell
9 Replies

7. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies
PASSWDQC.CONF(5)					      BSD File Formats Manual						  PASSWDQC.CONF(5)

NAME
passwdqc.conf -- libpasswdqc configuration file DESCRIPTION
libpasswdqc is a simple password strength checking library. In addition to checking regular passwords, it offers support for passphrases and can provide randomly generated ones. A passwdqc.conf configuration file may be used to override default libpasswdqc settings. FORMAT
A passwdqc.conf file consists of 0 or more lines of the following format: option=value Empty lines and lines beginning with ``#'' are ignored. Whitespace characters between the option, ``='', and value are not allowed. DIRECTIVE OPTIONS
config=FILE Load the specified configuration FILE in the passwdqc.conf format. This file may define any options described in this manual, including load of yet another configuration file, but loops are not allowed. PASSWORD QUALITY CONTROL OPTIONS
min=N0,N1,N2,N3,N4 (default: min=disabled,24,11,8,7) The minimum allowed password lengths for different kinds of passwords/passphrases. The keyword disabled can be used to disallow passwords of a given kind regardless of their length. Each subsequent number is required to be no larger than the preceding one. N0 is used for passwords consisting of characters from one character class only. The character classes are: digits, lower-case let- ters, upper-case letters, and other characters. There is also a special class for non-ASCII characters, which could not be classi- fied, but are assumed to be non-digits. N1 is used for passwords consisting of characters from two character classes that do not meet the requirements for a passphrase. N2 is used for passphrases. Note that besides meeting this length requirement, a passphrase must also consist of a sufficient number of words (see the passphrase option below). N3 and N4 are used for passwords consisting of characters from three and four character classes, respectively. When calculating the number of character classes, upper-case letters used as the first character and digits used as the last charac- ter of a password are not counted. In addition to being sufficiently long, passwords are required to contain enough different characters for the character classes and the minimum length they have been checked against. max=N (default: max=40) The maximum allowed password length. This can be used to prevent users from setting passwords that may be too long for some system services. The value 8 is treated specially: if max is set to 8, passwords longer than 8 characters will not be rejected, but will be truncated to 8 characters for the strength checks and the user will be warned. This is to be used with the traditional DES-based password hashes, which truncate the password at 8 characters. It is important that you do set max=8 if you are using the traditional hashes, or some weak passwords will pass the checks. passphrase=N (default: passphrase=3) The number of words required for a passphrase, or 0 to disable the support for user-chosen passphrases. match=N (default: match=4) The length of common substring required to conclude that a password is at least partially based on information found in a character string, or 0 to disable the substring search. Note that the password will not be rejected once a weak substring is found; it will instead be subjected to the usual strength requirements with the weak substring partially discounted. The substring search is case-insensitive and is able to detect and remove a common substring spelled backwards. similar=permit|deny (default: similar=deny) Whether a new password is allowed to be similar to the old one. The passwords are considered to be similar when there is a sufficiently long common substring and the new password with the substring partially discounted would be weak. random=N[,only] (default: random=47) The size of randomly-generated passphrases in bits (26 to 81), or 0 to disable this feature. Any passphrase that contains the offered randomly-generated string will be allowed regardless of other possible restrictions. The only modifier can be used to disallow user-chosen passwords. PAM MODULE OPTIONS
enforce=none|users|everyone (default: enforce=everyone) The PAM module can be configured to warn of weak passwords only, but not actually enforce strong pass- words. The users setting will enforce strong passwords for invocations by non-root users only. non-unix Normally, the PAM module uses getpwnam(3) to obtain the user's personal login information and use that during the password strength checks. This behavior can be disabled with the non-unix option. retry=N (default: retry=3) The number of times the PAM module will ask for a new password if the user fails to provide a sufficiently strong password and enter it twice the first time. ask_oldauthtok[=update] Ask for the old password as well. Normally, the PAM module leaves this task for subsequent modules. With no argument, the ask_oldauthtok option will cause the PAM module to ask for the old password during the preliminary check phase. If the ask_oldauthtok option is specified with the update argument, the PAM module will do that during the update phase. check_oldauthtok This tells the PAM module to validate the old password before giving a new password prompt. Normally, this task is left for subse- quent modules. The primary use for this option is when ask_oldauthtok=update is also specified, in which case no other module gets a chance to ask for and validate the password. Of course, this will only work with UNIX passwords. use_first_pass, use_authtok Use the new password obtained by other modules stacked before the PAM module. This disables user interaction within the PAM module. The only difference between use_first_pass and use_authtok is that the former is incompatible with ask_oldauthtok. FILES
/etc/passwdqc.conf. SEE ALSO
getpwnam(3), pam_passwdqc(8). http://www.openwall.com/passwdqc/ AUTHORS
The pam_passwdqc module was written for Openwall GNU/*/Linux by Solar Designer <solar at openwall.com>. This manual page was derived from pam_passwdqc(8). The latter, derived from the author's documentation, was written for the FreeBSD Project by ThinkSec AS and NAI Labs, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (``CBOSS''), as part of the DARPA CHATS research program. Openwall Project March 13, 2010 Openwall Project
All times are GMT -4. The time now is 04:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy