PasswordSecurityModule

A module that encrypt and encode passwords. It also generate fake passwords.

License

License

Categories

Categories

Security
GroupId

GroupId

com.lightszentip.module
ArtifactId

ArtifactId

password-security
Last Version

Last Version

1.0.0-RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

PasswordSecurityModule
A module that encrypt and encode passwords. It also generate fake passwords.
Project URL

Project URL

http://lightszentip.github.io/password-security/
Source Code Management

Source Code Management

https://github.com/lightszentip/password-security

Download password-security

How to add to project

<!-- https://jarcasting.com/artifacts/com.lightszentip.module/password-security/ -->
<dependency>
    <groupId>com.lightszentip.module</groupId>
    <artifactId>password-security</artifactId>
    <version>1.0.0-RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/com.lightszentip.module/password-security/
implementation 'com.lightszentip.module:password-security:1.0.0-RELEASE'
// https://jarcasting.com/artifacts/com.lightszentip.module/password-security/
implementation ("com.lightszentip.module:password-security:1.0.0-RELEASE")
'com.lightszentip.module:password-security:jar:1.0.0-RELEASE'
<dependency org="com.lightszentip.module" name="password-security" rev="1.0.0-RELEASE">
  <artifact name="password-security" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lightszentip.module', module='password-security', version='1.0.0-RELEASE')
)
libraryDependencies += "com.lightszentip.module" % "password-security" % "1.0.0-RELEASE"
[com.lightszentip.module/password-security "1.0.0-RELEASE"]

Dependencies

compile (2)

Group / Artifact Type Version
org.bouncycastle : bcprov-jdk16 jar 1.46
commons-codec : commons-codec jar 1.8

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

README

http://lightszentip.github.io/password-security/

Build Status

Getting Started

If you use maven, you need a maven build from the project. Then you can use the following dependency:

<groupId>com.lightszentip.module</groupId>
<artifactId>password-security</artifactId>
<version>1.0.0-RELEASE</version>

The artifact is in the maven central repository.

Use it

Example application https://github.com/lightszentip/password-security-example-app

First

Create a new instance of "PasswordModule":

PasswordModule passwordModule = new PasswordModuleImpl(String secretId, String secretSaltPw, String secureSaltKey, EncryptionType typeEncrypt, AlgorithmType typeEncod, int randomPasswordLength)

secretId - Salt value for encryption and encoding secretSaltPw - Salt value for password encoding secureSaltKey - Salt value for encryption typeEncrypt - Type for encryption typeEncod - Type for encoding randomPasswordLength - Length for fake passwords (honeywords)

Functions

This function generate a random password:

public String generateRandomPassword(int length);

This function generate a password with encryption and encoding:

public String getCodePassword(String password)

This function generate a password with encryption and encoding and fake passwords:

public String[] getHoneyPasswordList(String password, int size)

This function checks, is the variable password the right password. For this you need the whole list from "getHoneyPasswordList":

checkPassword(String[] passwordArray, String password)

If you want to encryption other values, you can use the following functions:

public String encrypt(String value, String key, EncryptionType type);
public String decrypt(String value, String key, EncryptionType type);

Example

PasswordModule passwordEncoder = new PasswordModuleImpl("secretid", "salt", "ThisIsaSaltValue", EncryptionType.AES, AlgorithmType.SHA_512, 20);
String[] passwordArray = passwordEncoder.getHoneyPasswordList("test", values);
Assert.assertTrue(passwordEncoder.checkPassword(passwordArray, passwordEncoder.getCodePassword("test")));

java.security.InvalidKeyException: Illegal key size or default parameters

If you get the exception, then you need to download "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files".

Bitdeli Badge

Versions

Version
1.0.0-RELEASE