incertia
incertia

Reputation: 11

GnuPG encrypt with private key

Suppose I would like to encrypt a file with my private key for whatever reason so that only people with my public key can have access to the file. How would I do this?

gpg --sign --armor file

does not work because if you omit the --armor and use

gpg --sign --compress-level 0 file

the plaintext appears in the file.gpg.

gpg --encrypt file

will also not work because that uses public keys. Does anybody know how to do this?

Upvotes: 0

Views: 1198

Answers (2)

Luc Deschenaux
Luc Deschenaux

Reputation: 9

You can encrypt your file symmetrically using your public key, so that everybody with access to your public key can decrypt your file.

Upvotes: -1

Perseids
Perseids

Reputation: 13260

You unfortunately have got some fundamental misconceptions about the cryptography you want use. By definition if you want to asymmetrically encrypt some data you need to use the public key and the encrypted data can only be decrypted with the private key.

If you want to encrypt a message so that only a certain group of people can access it you can asymmetrically encrypt it with all the public keys of each individual in the group or encrypt it symmetrically with a random key and share that key with each individual in the group.

Upvotes: 4

Related Questions