ruby - Rails app with basic symmetric encryption -
I am a fairly new developer and I have had to face my first project where it will definitely be able to store Encrypted field in database.
I am on the most current version of Ruby / Rail, hosted on Heroes and using GIT for source control. I have installed the simetric-encryption gem and sorted it to work. But, when it comes to security, I know that "sort" is not cut.
Therefore, I installed the env variable with a key inside the hierarchy and created a column in my database which : encrypted_access_code
. When I submit a form, when passing the : access_code
parameter, it stores an encrypted version inside the : encrypted_access_code
column. If I call the .decrypt
method on that string, then the method decrypts it properly and returns the original value. It seems, what I can tell, all are working properly.
The problem is that I am still able to call MyModel.access
_code in the console, and it returns the unencrypted value that column is now my database Does not exist in but it still lets me to call - is not good and I'm not sure where I went wrong I'm sure it has something to do with symmetric encryption and I do not fully understand it, but I take it up and walk Actually I'm not able to get a detailed guide. Using the manufacturer's site, I used my example to add the necessary bits to my model but I should remember something
thanks!
Comments
Post a Comment