This Artifact can be used to verify the user provided password is not one of the top 10,000 worst passwords as analyzed by a respectable IT security analyst. Read about all here, here(wired) or here(telegram)
- Java version Oracle JDK 7, 8 or OpenJDK 7
Include the following in your pom.xml
for Maven:
<dependency>
<groupId>com.unicodelabs</groupId>
<artifactId>java-dumb-passwords</artifactId>
<version>1.0.0</version>
</dependency>
###Jar-File You can also download the jar file from the latest release on the releases page.
A DumbPassword class provides one public method for checking dumb passwords. Instantianting the class is as given below:
final DumbPassword dumbPasswords = new DumbPassword();
Check if the string provided, representing the user's proposed submitted password is not one of the
top 10,000 worst passwords users use. returns true
if the password is one of them and false
if the password is not.
try {
if(dumbPasswords.checkPassword("gfdgfgghjgjghgk")){
System.out.println("This password is just too common. Please try another!");
} else {
//This password is awesome!
//This user SMART! Give them the Major key! #takeit!!
System.out.println("This password is awesome");
}
} catch (IOException ex) {
System.out.println(ex.getMessage());
} catch (IsNullException ex) {
System.out.println(ex.getMessage());
}
Here is an example
package com.unicodelabs.jdp.core.example;
import com.unicodelabs.jdp.core.DumbPassword;
import com.unicodelabs.jdp.core.exceptions.IsNullException;
import java.io.IOException;
/**
*
* @author Raphson
*/
public class DumbPasswordClient {
public static void main(String[] args) {
DumbPassword dumbPasswords = new DumbPassword();
try {
if(dumbPasswords.checkPassword("gfdgfgghjgjghgk")){
System.out.println("This password is just too common. Please try another!");
} else {
//This password is awesome!
//This user SMART! Give them the Major key! #takeit!!
System.out.println("This password is awesome");
}
} catch (IOException ex) {
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
} catch (IsNullException ex) {
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
If you discover a security vulnerability within Java-dumb-passwords java library , please send an e-mail to Ayeni Olusegun at nsegun5@gmail.com. All security vulnerabilities will be promptly addressed.
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!
Don't forget to follow me on twitter!
Thanks! Ayeni Olusegun.
The MIT License (MIT). Please see License File for more information.