functions for reading password from terminal