Ask for password input when mounting a volume via Automator
I don't think the "Ask for Text" action provides that feature so you'll have to run an AppleScript command instead to display the dialog:

on run {input, parameters}
    return {text returned of (display dialog "Password:" ¬
        default answer "" with icon note buttons {"Cancel", "Enter"} ¬
        default button "Enter" with hidden answer)}
end run


which produces the following dialog:


Now, I don't know about hdiutil but this is how you might be able to use it: