What I've always done was to make a flatfile with that info, give it
ownership of an account that has limited privilages and then set that
file's perms so it can only read it. You can encypt and decrypt the
file.
There should also be modules out there that would allow you to read info
from an NIS table and that could be done through a secure
connect... probably would require root.
I cannot think of any more secure way to do it. There's no such thing as
a totally secure process and grabbing the account info out of a protected
file with an account with limited privilages is probably about as secure
as you will get.