[4.2] Validate passwords more safely

As requested.