21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

file, it may allocate a sizable amount of memory that remains allocated. When you’re<br />

done generating passphrases, you should call spc_generate_cleanup( ) to close the<br />

data file and free the memory allocated by spc_generate_passphrase( ).<br />

void spc_generate_cleanup(void) {<br />

if (spc_wordlist_file) fclose(spc_wordlist_file);<br />

if (spc_wordlist_offsets) free(spc_wordlist_offsets);<br />

spc_wordlist_file = 0;<br />

spc_wordlist_offsets = 0;<br />

spc_wordlist_count = 0;<br />

spc_wordlist_shortest = 0;<br />

}<br />

See Also<br />

Recipe 11.11<br />

8.6 Testing the Strength of Passwords<br />

<strong>Problem</strong><br />

You want to ensure that passwords are not easily guessable or crackable.<br />

Solution<br />

Use CrackLib, which is available from http://www.crypticide.org/users/alecm/.<br />

Discussion<br />

When users are allowed to choose their own passwords, a large number of people<br />

will inevitably choose passwords that are relatively simple, making them either easy<br />

to guess or easy to crack. Secure passwords are often difficult for people to remember,<br />

so they tend to choose passwords that are easy to remember, but not very<br />

secure. Some of the more common choices are simple words, dates, names, or some<br />

variation of these things.<br />

Recognizing this tendency, Alec Muffett developed a program named Crack that<br />

takes an encrypted password from the system password file and attempts to guess—<br />

or crack—the password. It works by trying words found in a dictionary, combinations<br />

of the user’s login name and real name, and simple patterns and combinations<br />

of words.<br />

CrackLib is the core functionality of Crack, extracted into a library for the intended<br />

purpose of including it in password-setting and -changing programs to prevent users<br />

Testing the Strength of Passwords | 391<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!