Migrate salt and hash generation to dedicated methods

Doing so makes it easier for subclasses to override the crypt call.