Comments (6)
Hey @birthdaycorp, if ENV['LOCKBOX_KEY']
is your master key, check out the section on key separation: https://github.com/ankane/lockbox#key-separation
from lockbox.
Re LOCKBOX_MASTER_KEY
: that makes more sense, and the link above still applies.
Re missing attribute: attribute_ciphertext
only applies to encrypted database fields, not encrypted uploads. The readme has instructions in the CarrierWave section for how to present encrypted uploads to users.
from lockbox.
Thank you for the response! The key is actually LOCKBOX_MASTER_KEY
. Does that make any difference? Additionally, I'm using Carrierwave, and I want to display the decrypted files in the view. Model.attribute_ciphertext
returns the cipher, but calling the encrypted attribute like Model.attribute
returns a missing attribute error. Is that expected?
from lockbox.
Hmm, I'm afraid I'm still confused by the suggestions in the doc. Assuming that the class I'm using lockbox for looks like this...
class License < ApplicationRecord
encrypts :doc_front
encrypts :doc_back
end
...it seems safe to assume that that controller action would be written like this:
send_data @user.license.doc_front.read, type: @user.license.doc_front.content_type
Yet this is where I get that missing_attribute: 'doc_front'
error.
from lockbox.
Check out the CarrierWave docs, as they don't mention using the encrypts
method: https://github.com/ankane/lockbox#carrierwave
If you need additional help, please use Stack Overflow.
from lockbox.
So just to be clear then: if I am encrypting a file upload with CarrierWave, there is no reason to add a _ciphertext
to the database field? Thanks!
from lockbox.
Related Issues (20)
- Rotating master key gives ActiveRecord::RecordNotSaved HOT 1
- Decryption using PHP is not Working HOT 4
- Access to the unencrypted attachable when using ActiveStorage HOT 2
- [Question] - Migrating from `attr_encrypted` with `marshal: true` HOT 3
- Lockbox raises MissingAttributeError when encrypted attribute is backed by store_attribute when using select HOT 1
- `Lockbox.rotate` bypasses `default_scope` if passed a model HOT 1
- GCM-SIV HOT 1
- Devise Invalid Credentials after table name changed HOT 3
- Search in encrypted data HOT 1
- Unable to rotate encryption for fields having custom key_table HOT 2
- Idea: console1984 integration
- Missing keyword: :coder error for Rails 7.1 when using `has_encrypted :name, type: :array` HOT 3
- Corrupted strings on save + reload with multi-byte UTF-8 characters with ActionText::RichText on Rails 7.1 HOT 5
- Idea: Don't return virtual attributes in attribute methods unless the ciphertext attribute is present HOT 2
- update_all doesnt work with Lockbox after deleting old column. HOT 2
- How to force migration again.
- Use with bcrypt HOT 1
- Can't use `Lockbox.migrate(User)`: can't convert Date to String (`v.1.3.3`) HOT 1
- How to access encrypted values from rails console? HOT 1
- Create a migration that includes `Lockbox.migrate(User)` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lockbox.