Recently, I made a script that archives important files with gzip,
encrypts them with gpg, using
gpg --symmetric
(which prompts me for a password), then
uploads it.

I was testing the backup on another PC, but cannot decrypt it, even when I supplied the correct password (copy& pasted from password manager). There was an error about half a second after and it failed with an invalid packet error.

How can I encrypt that file, so anyone with the proper password can decrypt it? I don't want to share keyrings as I've read elsewhere unless absolutely necessary, as it's another thing I need to think of and distribute and sync between my machines, including future ones. I would like to decrypt it with just a password.

  • 2
    The command is correct. Encrypt with: gpg --symmetric filename, decrypt with gpg --decrypt filename.gpg. What does your script look like? What command do you use to decrypt it? – Deathkamp Drone Apr 5 at 2:00
  • What was the exact error? It sounds like the password was correct, but something else went wrong? If you don't specify a good --cipher-algo or use --force-mdc you might default to not having any modification detection code. Are you sure the file was transferred unchanged? And +1 to DeathkampDrone's comments too – Xen2050 Apr 6 at 4:10
  • Okay, I was able to decrypt it and I can access the files, but I'm not sure if the backup is complete. While decrypting: "gpg: problem reading source (xxx bytes remaining) gpg: handle plaintext failed: No such file or directory gpg: decryption failed: Invalid packet". I'll verify if hash of the uploaded/downloaded file matches. I didn't specify any of these options, it defaulted to AES. Cc @Deathkamp Drone : I used the commands that you wrote. – SoptikHa Apr 6 at 15:20

Your Answer

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

Browse other questions tagged or ask your own question.