A simple way to encrypt and decrypt in Rails 5
Daveyon Mayne
1069

Just to update couple of the things in this guide and thinking more abstract, you could create a module like the following that could use the Rails secret_key_base defined on the secrets.yml file for encryption:

And then go to the model you need the encrypted attrs and extend encryptor by specifying the attribute names you want to be encrypted.

Like what you read? Give Loucas Anagnostou a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.