liveBook · Manning

Password-strength algorithm

As explained in BDD in Action, Second Edition

A password-strength algorithm is an algorithm that evaluates the resistance of a password to guessing or cracking.

A registration team may start with a list of password rules, then discover that the real goal is to keep member accounts secure. A password-strength algorithm is one possible way to assess candidate passwords against that goal. It shifts the discussion from enforcing a particular rule set to deciding which passwords are strong enough to accept. section 6.2

Password

Strength

Acceptable

secret

Weak

No

password

Weak

No

password1

Weak

No

aBcdEfg1

Weak

No

qwertY12

Weak

No

dJeZDip1

Medium

Yes

SeagullHedgehog

Strong

Yes

SeagullHedgehogCatapult

Very strong

Yes

Use the sample-password table to discuss both strength ratings and the acceptance threshold. It rates “password1” weak and unacceptable, “dJeZDip1” medium and acceptable, and “SeagullHedgehog” strong and acceptable. section 6.2

Agree on examples before committing to an implementation. A team can try existing libraries, gather stakeholder feedback, and keep the integration replaceable if another library or a custom algorithm proves more suitable. The acceptance threshold is itself a decision to make explicit: one set of examples accepts medium-strength passwords, while a later UI criterion calls for strong passwords only. section 6.2 section 10.2.3

Test the two responsibilities at different levels. An automated web test can check that the page gives users strength feedback. Application code–level tests are better suited to checking which passwords the algorithm accepts; repeatedly submitting candidates through the interface would be wasteful. section 10.2.3

How BDD in Action, Second Edition covers it

How deep it goes
Explains selection and testing through examples, but does not specify a scoring formula or algorithm implementation.
Examples
Compares rated sample passwords, including weak “password1,” medium “dJeZDip1,” and strong “SeagullHedgehog.”
What it assumes
Assumes familiarity with registration requirements and acceptance criteria; introduces the choice between an existing library and a custom algorithm.
What you can do after
Evaluate/understand candidate strength criteria and choose appropriate test levels for feedback and acceptance behavior.
How it connects
Connects password strength to acceptance criteria, password validation, UI feedback, automated web tests, and application code–level tests.

This explainer was generated by Manning's knowledge graph from the text of BDD in Action, Second Edition. The section links point to the parts of the book it draws on.