Improve poor security recommendation in docs

As reported in #9960, the current documentation recommends an insecure practice for
key generation from a password (a single round of SHA-256). The modified documentation
uses ActiveSupport::KeyGenerator to perform proper key stretching.
Merge pull request #9980 from stouset/patch-1

Improve poor security recommendation in docs

[ci skip]