fix update of ‘salt’ field

refactor the genPassword to its own file.
fix update of ‘salt’ field

refactor the cryptographic stuff to its own file.