added functions, generalized pbkdf2