Working implementation of PBKDF2