add encryption functions that take salt argument

IO cannot be used in some situations, e.g. an acid-state based
password store, so add variants of the encryptPass functions that
have an explicit salt argument, as well as a function to generate a
random salt.

---

I look forward to feedback on this change.