Git Product home page Git Product logo

zeoflow / password-strength Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 9.0 882 KB

Check password strength (Weak, Medium, Strong, Very Strong). Setting optional requirements by required length, with at least 1 special character, numbers and letters in uppercase or lowercase.

Home Page: https://zeoflow.github.io/password-strength/

License: Apache License 2.0

Java 99.87% Kotlin 0.13%
zeoflow password password-strength password-meter android-library zeoflow-library

password-strength's Introduction

Password Strength for Android

Intro

Password Strength is an Android Library that checks for a password strength.

Getting Started

For information on how to get started with Password Strength, take a look at our Getting Started guide.

Submitting Bugs or Feature Requests

Bugs or feature requests should be submitted at our GitHub Issues section.

How does it work?

1. Depend on our library

Password Strength for Android is available through Google's Maven Repository. To use it:

  1. Open the build.gradle file for your application.

  2. Make sure that the repositories section includes Google's Maven Repository google(). For example:

      allprojects {
        repositories {
          google()
          jcenter()
        }
      }
  3. Add the library to the dependencies section:

      dependencies {
        // ...
        implementation 'com.zeoflow:password-strength:<version>'
        // ...
      }

2. Activity/Fragment Class

MainActivity.java

public class MainActivity extends BindAppActivity<ActivityMainBinding, MainViewBinding>
{
    //..
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        //..

        // Create a map of excluded words on a per-user basis using a hypothetical "User" object that contains this info
        List<Dictionary> dictionaryList = ConfigurationBuilder.getDefaultDictionaries(this);
        dictionaryList.add(new DictionaryBuilder(this)
            .setDictionaryName("exclude")
            .setExclusion(true)
            .addWord("word", 0)
            .createDictionary());

        // Create our configuration object and set our custom minimum
        // entropy, and custom dictionary list
        Configuration configuration = new ConfigurationBuilder()
            .setMinimumEntropy(40d)
            .setDictionaries(dictionaryList)
            .createConfiguration(this);

        // Create our PasswordChecker object with the configuration we built
        PasswordChecker passwordChecker = new PasswordChecker(configuration);

        // passwordStrength is of PasswordType type
        // PasswordType can be (VERY_WEAK, WEAK, MEDIUM, STRONG, VERY_STRONG)
        PasswordType passwordStrength = passwordChecker.estimate("asdasdssd").getStrength();

        //..
    }
    //..
}

License

Copyright 2020 ZeoFlow

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

password-strength's People

Contributors

teogor avatar zeobot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

password-strength's Issues

Migrate to Java 11

Is your feature request related to a problem? Please describe.
Migrate to Java 11 and upgrade to gradle 7.0

We also happily accept pull requests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.