This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; |