I am using rails attr_encrypted gem for encrypting data before storing in database. It works fine on my application as it encrypts with the provided key and decrypts it using the same key via my application. But when I create a instance with my rails console, it does not encrypt with the key that is provided in the application ( uses some random key each time maybe) and hence I am not able to decrypt it when I see that instance in my application.
Below picture shows that if I create the user with the same name twice in console, each time the encrypted data is different. I am following the tutorial on this page
When I try to access the page on my application, the user made by console are showing this error
Aucun commentaire:
Enregistrer un commentaire