Unfortunately I have a really hard time finding proper documentation on this function. Looking at the code I'm not quite sure why you chose sha386 instead of sha256 for generating a 256bit key output. Just to make it slower? Why not use sha512 outright then instead of the truncated version? Not that I think it's an issue security wise (obviously not a cryptographer but from my layman's POV the iterative nature of the PBKDF2 shouldn't let you skip any work if all we do is truncate the final result). Did you consult/find any information I might take a look at? I doubt we can do any worse than what we have with unsalted SHA1 but we might as well get it right (TM).