The following Haskell program prompts the user for a password in the terminal and continues if he has entered the correct one:
main = do putStrLn \"Password:
There is a getPassword in System.Console.Haskeline. Probably it's an overkill for your case but someone may find it useful.
System.Console.Haskeline
An example:
> runInputT defaultSettings $ do {p <- getPassword (Just '*') "pass:"; outputStrLn $ fromJust p} pass:*** asd