password protected db writing