I am working on an encrypted data set. And using the code below to decrypt files.

openssl enc -aes-256-cbc -d -in $encryptedfile -out $decrypted_file -pass file:secret.txt

But I am always notified with this error:

error writing output file
  • are you sure you have write privileges for the output directory ?
    – MelBurslan
    Mar 21 '16 at 16:13
  • What is the output if you run this with strace? It should show the error.
    – Chris Down
    Mar 21 '16 at 16:58
  • Don't use openssl. It's very hard to use correctly, it's just a debugging tool. The robust way to encrypt a file is with gpg. Mar 21 '16 at 22:56
  • @MelBurslan It might be yes. Because I find a new file is created, but nothing in that file.
    – Vision
    Mar 23 '16 at 14:40
  • @Gilles Can you give an example for my case? I tried "gpg -d $encryptedfile" but got error messages. BTW, my encrypted file name is ".aes"
    – Vision
    Mar 23 '16 at 14:54

It seems I don't have enough space to write decrypted files. But of course, we need to get the writing permission before using openssl to decrypt files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.