Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

cbourgois/cryptoJsPasswordEncoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoJsPasswordEncoder

Simple Message Digest Password Encoder with CryptoJS lib

Reproduces Symfony MessageDigestPasswordEncoder's behavior in javscript with CryptoJs library.

Installation

Via Bower:

bower install cryptojs-password-encoder --save

And in your html file:

<script type="text/javascript" src="bower_components/cryptojslib/rollups/sha512.js"></script>
<script type="text/javascript" src="bower_components/cryptojslib/components/enc-base64.js"></script>

<script type="text/javascript" src="bower_components/cryptojs-password-encoder/CryptoJsPasswordEncoder.js"></script>

Usage

var encoder = new CryptoJsPasswordEncoder('sha512', true, 5000);

encoder.encodePassword('pass0', 'salt');
// returns "UcC4fzoeOb94BdO3stpYywrwaTGeZaLhS2ywdso7t2ZHnf3vjmLMyEZ4j7IMpj9ZZdRGjhw9K0Fc1XDhbcL3bQ=="

About

Simple Message Digest Password Encoder with CryptoJS lib

Resources

License

Stars

Watchers

Forks

Packages

No packages published