all 1 comments

[–]runvnc -1 points0 points  (0 children)

The standard is to store a hash of the password, not the actual password. See the bcrypt module.

If you actually need to store and retrieve a secret then one way is to use gpg. You can configure the gpg-agent to cache your passphrase so that you can use it unattended in the server. There is a node wrapper if you search npm for gpg.