Questions tagged [attr-encrypted]

63 questions
0
votes
0 answers

Upgrading from attr_encrypted and Vault-rails for same key

I was using attr_encrypted mechanism previously, attr_encrypted :ssn, key: :encryption_key, algorithm: 'bf-cfb', mode: :single_iv_and_salt, insecure_mode: true and I upgraded it to vault-rails: include Vault::EncryptedModel vault_attribute :ssn I…
0
votes
1 answer

Migration from attr_encrypted to vault-rails gem

Earlier my code was having encryption methodology using 'attr_encrypted' but later I changed my mind to integrate vault for encryption/decryption. So I want to understand how can I migrate my old saved encrypted data to new one.
0
votes
1 answer

Update encrypted fields for a different key

Actually, I started with encrypting user_pass field with hard-coded key. class Credential < ApplicationRecord .. attr_encrypted :user_pass, key: 'This is a key that is 256 bits!!' .. end I already have some data encrypted with this key. Now,…
Rajkaran Mishra
  • 4,532
  • 2
  • 36
  • 61
0
votes
1 answer

Updating existing unencrypted records with attr_encrypted

How do I update existing records that were previously unencrypted with the gem attr_encrypted. I currently have the column text in a table called AppointmentNote which is just a string. I now want to have a column called note which is encrypted…
0
votes
1 answer

must specify an iv attr_encrypted, how to check login and password

Hi have the following model: class User < ActiveRecord::Base secret_key = ENV['DB_COL_ENCRYPTED_KEY'] attr_encrypted :email, :key => secret_key attr_encrypted :password, :key => secret_key [...] end Where I added the 4 cols to…
Djodjo
  • 95
  • 10
0
votes
1 answer

Rails test throwing Deprecation Warning over attr_encrypted

Rails test is throwing a deprecation warning over a gem (attr_encrypted) which is already updated to the latest version. It reads: DEPRECATION WARNING: is not an attribute known to Active Record. This behavior is deprecated…
user8897013
  • 443
  • 4
  • 15
0
votes
0 answers

Rails console issue with attr_encrypted

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…
0
votes
0 answers

rake db:seed only works when in its own rake

Here's two commands while using attr_encrypted: # Seed fails to populate encrypted fields rake db:drop db:create db:migrate db:seed # Seed succeeds rake db:drop db:create db:migrate rake db:seed When I say that seed 'fails', I mean that the…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
0
votes
1 answer

Rails accessing private methods using attr_encrypted

I'm trying to get attr_encrypted to obscure some data before saving it to the database. I need to deal with the logger output later, but at the moment I just want to get the field data from a submitted form, encrypt it, and save it. Here's my…
DanielNordby
  • 569
  • 2
  • 6
  • 20
0
votes
1 answer

Using ruby attr-encrypted gem without changing table column names

I have an existing project that I am now trying to update to use the attr-encrypted gem to encrypt some of my existing table columns. Everything works as expected IF I update the names of the table attributes that I want encrypted to start with…
Hawkeye001
  • 791
  • 2
  • 11
  • 25
0
votes
1 answer

Algolia searching encrypted data

Currently, my database has encrypted data which I send to Algolia. I need to search on this encrypted data but if indexed is 'John' and I search 'Joh', they are not similar at all, and thus result to 0 hits. Any ideas how to solve this? I am…
Mohamed El Mahallawy
  • 13,024
  • 13
  • 52
  • 84
0
votes
2 answers

update old values in production database to new

I'm adding encryption using the attr_encrypted gem. Essentially all I have to do is add the gem, and rename my columns to have a prefix of encrypted_column before adding the line: attr_encrypted :reply, key: ENV["ANSWER_CRYPT_KEY"] to my model.…
0
votes
2 answers

Ruby on Rails - why should certain data be encrypted?

Encrypting data Having just finished adding attr_encrypted to some models, I've come to think that a hackers job might not be that hard. I've got a database on a different server to the app servers - however, chances are that if someone managed to…
cb24
  • 577
  • 5
  • 7
0
votes
1 answer

undefined method attr_encrypted in Rails 2.3 app

I'm maintaining a Rails 2.3 app (moving to Rails 4 broke too many things), and trying to encrypt/decrypt a password instead of saving it plain-text in the database. Following the instructions for the attr_encrypted gem, I added gem…
0
votes
1 answer

mongoid: how to store an encrypted BSON::Binary field?

I started using mongodb in my application and I'm now looking for an easy way to encrypt some sensitive binary data and store it in the mongodb. When I do it for my MySql DB I use the attr_encrypted, but I guess that with mongoid, I'll need some…
benams
  • 4,308
  • 9
  • 32
  • 74