Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1057  / 1 Year ago, tue, may 16, 2023, 6:30:42

Last night my system shutdown unexpectedly and when i restart it, it gave me superblock error. will then i fixed a little but. i was able to retrive my encrypted files which i encrypted my pgp public key but i was not able to retrive my private key or public key



now i have ecrypted file which cannot be open because i have lost my private key.



is there any way that i can encrypt my file by providing only master password and passphrase and no physical key or private key



and when i am on another computer i can easily open it my same master password and passphrase.



Thanks in advance


More From » ssh

 Answers
1

is there any way that i can encrypt my file by providing only master
password and passphrase and no physical key or private key ... and
when i am on another computer i can easily open it my same master
password and passphrase.




Yes, definitely.

Every time you try to encrypt some input, GnuPG actually generates a random session key which it then uses to symmetrically encrypt the input (using whichever cipher-algo is specified -- CAST5 by default). Then the session key is encrypted with any combination of passphrases & gpg public keys and THOSE are what you use to access the data.



Here's an example of running gpg to encrypt some data and make it accessible via both a simple passphrase and a couple public keys:



gpg -cer barack@devnull --cipher-algo aes256 -r bob@devnull <FILE>


Note that cipher-algo is of course optional.






EDIT:

Per request, here's a simplified example which only uses a symmetric key.



gpg -c --cipher-algo aes256 --force-mdc <FILE>


See the man page for an explanation of --force-mdc, but note that I added it on purpose; by default it's not used when only doing -c/--symmetric.


[#35755] Thursday, May 18, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lintical

Total Points: 344
Total Questions: 122
Total Answers: 106

Location: Sint Maarten
Member since Mon, Oct 12, 2020
4 Years ago
;