ankit8898 / carrierwave_encrypter_decrypter

Secure your Carrierwave file uploads/uploaded files by Encryption and Decryption using Openssl AES and OpenSSL::PKCS5
28 stars 24 forks source link

Files are not being encrypted #7

Open ChristofferJoergensen opened 8 years ago

ChristofferJoergensen commented 8 years ago

I am using the standard setup:

Carrierwave::EncrypterDecrypter.configure  do |config|
  config.encryption_type = :aes
  config.key_size = 256
end
class ScreenshotUploader < CarrierWave::Uploader::Base
  storage :file

  after :store, :encrypt_file

  def encrypt_file(file)
    Carrierwave::EncrypterDecrypter::Uploader.encrypt(self)
  end

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
end

However, files are being stored in their original form, not as .enc files. The only difference I can think of between the suggested setup and my own setup is that I'm using Mongoid as db. I don't suppose that makes any difference though.

Any idea how to approach this?

vkeziah commented 7 years ago

I see the same issue on my end , files are not being encrypted and I see the following error on encryption

No such file or directory "...uploads/document/data/318/demo.docx.enc"