I feel compelled to revive this old (almost 10 years!) thread because I���m faced with a similar problem and certain points seem unresolved.

Assuming that one needs the actual password in the image (in my case to authenticate via IMAP), Norbert���s suggestion to have a helper app that runs with elevated privileges makes sense, but I���m wondering about a few other comments:

As I was thinking through my use case, I was considering, for example, storing the password in a non-string collection e.g. ByteArray, so that I could use the password and zero it out in memory right afterward.