Skip to content

Instantly share code, notes, and snippets.

@folsen
Created September 29, 2011 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save folsen/1252103 to your computer and use it in GitHub Desktop.
Save folsen/1252103 to your computer and use it in GitHub Desktop.
Plotting password strength
% Word passwords
w = @(x) 20000.^x;
% Letter passwords (big and small letters a-Z)
l = @(x) 54.^x;
% Alphanumeric passwords (0-9 a-Z and !"#€%&/()=?_-)
an = @(x) 77.^x;
X = 0:20;
semilogy(X,w(X),'b',X,l(X),'r',X,an(X),'k')
hold on
semilogy([0,20], w([4,4]),'m')
legend('Words', 'Letters', 'Alphanumerical')
xlabel('Password length (Number of #)')
ylabel('Possible combinations (Strength)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment