Password encoding and checking utilities.