Our Rails app needed to keep user name and account information more secure, so we implemented
an encryption gem to store encrypted data. This encryption allows for writing and reading
encrypted field contents, and it isolates the encryption fields to the rails model
and database, while allowing the rest of the rails application – controller and views –
to use “normal” field names. This is demonstrated below using rails console.
———————————————————————————
———————————————————————————
(Command image pulled from Heroku, substitue ATTR_ENCRYPT_KEY, or whatever you
name your environment variable.)
———————————————————————————
———————————————————————————