Use crypto library for salt generation, fix tests, fix pagination