GPG encrypt a file with only a passphrase (no key storage needed)

9,604

What you want is called symmetric encryption -- where the same key is used for both encryption and decryption -- and yes, GnuPG can do it.

Use --symmetric or -c instead of -er RECIPIENT.

PS: You can combine the two modes so that a file can be decrypted by either the symmetric passphrase or by any of the RECIPIENT private keys.

Share:
9,604

Related videos on Youtube

user123456
Author by

user123456

Updated on September 18, 2022

Comments

  • user123456
    user123456 over 1 year

    Is there a GPG encryption mode that does not requires to have a specific public key stored and requires only one passphrase to be decrypted?

    It would make the decryption possible on any machine if the passphrase is known.


    PS:

    I don't want to use openssl since I cannot do in place encryption easily.

    In gpg

      cat file | gpg -e >  file
    

    is encrypting the file.

    Whereas

    cat file | openssl enc -des3   >  file
    

    produces an empty file.

    • Videonauth
      Videonauth over 7 years
      I don't think this is possible, pgp or Gnupgp are using two key encryption, so you would always need your private key in whatever environment you trying to decrypt and at least would need the public one for encryption.
    • user123456
      user123456 over 7 years
      I guess a passphrase protected private key uploaded on server would make it.
  • addicted
    addicted about 4 years
    How do you combine the symmetric and asymmetric mode?
  • Penguin9
    Penguin9 over 3 years
    How do you combine the symmetric and asymmetric mode?
  • Kevin Detrain
    Kevin Detrain over 3 years
    @addicted @Penguin9 I guess I thought it was obvious what "combine these two modes" meant... You can do this simply by using all 3 options, e.g., gpg -c -e -r RECIPIENT.