Giter VIP home page Giter VIP logo

Comments (6)

ankane avatar ankane commented on May 29, 2024 1

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.

ankane avatar ankane commented on May 29, 2024 1

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.

birthdaycorp avatar birthdaycorp commented on May 29, 2024

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.

birthdaycorp avatar birthdaycorp commented on May 29, 2024

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.

ankane avatar ankane commented on May 29, 2024

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.

birthdaycorp avatar birthdaycorp commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.