Skip to content

Instantly share code, notes, and snippets.

View jether2011's full-sized avatar
🎯
Focusing

Jether Rodrigues do Nascimento jether2011

🎯
Focusing
View GitHub Profile
@jether2011
jether2011 / Hasher.java
Created December 1, 2016 17:25 — forked from lukaszb/Hasher.java
Java implementation of Django PasswordHasher
/* Example implementation of password hasher similar on Django's PasswordHasher
* Requires Java8 (but should be easy to port to older JREs)
* Currently it would work only for pbkdf2_sha256 algorithm
*
* Django code: https://github.com/django/django/blob/1.6.5/django/contrib/auth/hashers.py#L221
*/
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;