gpg decryption is wonky
It's encrypting okay but when it comes to decryption
Code:
gpg filename.gpg Code:
gpg RuleNumber1.png.gpg But sometimes it works properly. And sometimes it decrypts the file without the password box! Kind of scary. Any ideas? |
That’s pretty clear...you didn’t give a command...
What were you trying to do? Decrypt? Then Code:
gpg —decrypt filename (Oh...you said you were decrypting, so just include the command) |
2 Attachment(s)
Quote:
Code:
gpg -decrypt filename Code:
gpg --decrypt filename (Seems to me you used an em-dash, not a hyphen or hyphens. Did you mean to do that?) See "encrypt" attachment for what I was doing to encrypt and "decrypt" for what I was doing to decrypt. But like I said doing it this was unreliable. Most of the time it didn't work and the some times it even worked without a passcode. I did look over the man page but there seemed to be multiple ways to encrypt and it was confusing. So what's the simplest way to encrypt and decrypt a file? Thanks. |
That was dash dash...Safari is messing it up.
See man gpg2 — command is always required Quote:
|
Quote:
Code:
gpg -e filename Because when I do that, I get this: Code:
gpg -e fireman.png |
Keys are associated with a user. You need to specify which user.
Note: I don’t know the answers...I’m just reading the man page. Another option is to search the web for the error. |
The way I see it:
Before you can encrypt a file, first set up keys for a user, for example gpg --generate-key. You will be asked for name, email address, passphrase. Keys are stored in $HOME/.gnupg. To encrypt a file, gpg -r USER -e myfile, where USER is name or email address provided in the key generation step. The encrypted file is named myfile.gpg. To decrypt the file, gpg -d myfile.gpg. This asks for the passphrase and writes the decrypted content to stdout. EDIT: When you leave out the command (--decrypt, --encrypt, --generate-key etc), gpg is supposed to guess what you want. Therefore, Gregg Bell's original command should figure out that the input file is encrypted and should automatically decrypt it. I don't have information (or experience, to be honest) to understand what makes it fail, but personally, I feel more confident when I tell the computer exactly what it should to rather than relying on heuristics. The GPG manual documents options and helper tools like gpg-agent, but it misses a "first steps" section and doesn't seem to cover typical workflows. There are a number of tutorials on the internet, though. When the official documentation of a tool is lacking, I tend to check whether there is something on the Archlinux wiki or in the DigitalOcean tutorials. Both web sites have high-quality content in my opinion. |
^^My guess is that the OP had missed the step of creating keys...I certainly didn't see that requirement until my upteenth pass through the man pages...and even then, not being interested in doing it myself, didn't even look to see how to do that step.
Definitely a lot of manual to read. Excellent, well-focused post, berndbausch (As usual) |
2 Attachment(s)
Quote:
As it is, I think I'm going to get rid of the encrypted files I have (created with the above method) because some of them get opened without requiring passwords. |
I note this at the bottom of the posts in the link posted in #9
Quote:
|
Quote:
My latest sticking point is (I was following berndbausch's advice) when I got to the passphrase step I ran into this: Quote:
|
Help the kernel generate random data by doing random things as described.
If your computer is a virtual machine, install haveged to speed up the random number generation process, otherwise it can take minutes or hours to accomplish this step. |
Quote:
|
All times are GMT -5. The time now is 08:38 AM. |