1 year ago

#364675

test-img

aclui dll

"gpg: decryption failed: No secret key" on another system

I'm trying to decrypt passwords in pass using gpg (they were also encrypted with gpg) on ​​a new system with a new user. I did not format the /home section to keep everything I need (configs, passwords, .gnupg, .password-store, etc.). I think I've already tried everything, but it all ends with the gpg: decryption failed: No secret key. Sorry if I didn't tell some more information you expected, but you can tell me what do you exactly need and I'll get everything for you.

This question exists and it was solved in 2017, but it didn't help me at all. Sorry if I have that problem just because i did something wrong. And thank you

There was such a file: ~/.password-store/.gpg-id. Having previously copied the .gnupg from the backup to ~/ and using the command sudo chown -R leo:staff ~/.gnupg (leo is a user on the new system on which I'm sitting right now), I did the following using the contents of the .gpg file -id(3D8ABF94A4E38339):

  • $ gpg --export 3D8ABF94A4E38339 > pub.key
  • $ gpg --export-secret-keys 3D8ABF94A4E38339 > sec.key
  • gpg: key 3D8ABF94A4E38339/82E95B5A6D369E55: error getting keyinfo from agent: Invalid argument - skipped
  • $ gpg --import pub.key
  • gpg: key 3D8ABF94A4E38339: "Leonid <ma1l>" not changed
  • gpg: Total number processed: 1 -gpg: unchanged: 1
  • $ gpg --import sec.key
  • gpg: key 3D8ABF94A4E38339: "Leonid <ma1l>" not changed
  • gpg: key 3D8ABF94A4E38339: secret key imported
  • gpg: Total number processed: 1 -gpg: unchanged: 1
  • gpg: secret keys read: 1
  • gpg: secret keys unchanged: 1
  • $ pass -c social/spotify
  • gpg: decryption failed: No secret key

I don't know what the third line from top to bottom means, but it seems to me that it is important, and the whole problem lies in it. I think that the problem is with the secret key, because it is necessary for decryption. Encrypting some file (with the --recipient 3D8ABF94A4E38339 option), I don't see any errors (public is used here, so everything is ok with it), and when decrypting (with the same option), the last line comes out.

I think my mistake is that I am using the wrong secret key (yes, my guesses are strange), but to be completely sure of this, I need to know which secret key belongs to a particular encrypted file (most likely, the concepts of "ownership " doesn't exist here though, mb, I'm wrong), at least id know which private key it's accessing. But, on the other hand, the key id (.gpg-id) is already in the .password-store directory. BTW, when exporting the key secret, I needed to enter a passphrase. It was this passphrase that I used earlier on another system to access my passwords. That is, this is a sign that I seem to have exported the correct secret key.


Basically, I don't know what to do. I googled that problem, saw it on SOF, but the solution didn't work for me(actually I described that one some lines higher). I have an untouched backup with all files, configs, etc., but I don't know how to properly use all this. Help me please

linux

gnupg

password-encryption

gpg-agent

0 Answers

Your Answer

Accepted video resources