iamraphson / java-dumb-passwords

Guard your users against entering dumb passwords in your java or JavaEE apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-dumb-passwords

Guard your users from security problems by preventing them from having dumb passwords

Introduction

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)

Installation

Prerequisites

  • Java version Oracle JDK 7, 8 or OpenJDK 7

Maven

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.

Usage

A DumbPassword class provides one public method for checking dumb passwords. Instantianting the class is as given below:

final DumbPassword dumbPasswords = new DumbPassword();

API

dumbPasswords.checkPassword(string) => true or false

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());
}

Example

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);
        }
    }
}

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Security Vulnerabilities

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.

How can I thank you?

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.

License

The MIT License (MIT). Please see License File for more information.

About

Guard your users against entering dumb passwords in your java or JavaEE apps

License:MIT License


Languages

Language:Java 100.0%