Mailing List Archive

All my Passwords are lost
Hello all,

Perhaps somebody out there could be of some help. I use since 10 years now GnuPG in my Shell to encrypt my Passwords. I only open this file, from time to time to look up some pws which I need for banking, crypto or to check, which of my many mails I used on which webpage.

After use I remove the pw.txt file immediately with my shell. All what is left is the file pw.txt.gpg.

Now after such a long time, something strange happened: this file is apparently encrypted with a foreign private key, which I never have had:

gpg: WARNING: no command supplied. Trying to guess what you mean ...
gpg: encrypted with 2048-bit ELG key, ID 1F1EF0849B5C6D50, created 2019-06-30
"PAUSE Batch Signing Key 2021 <pause@pause.perl.org>"
gpg: decryption failed: No secret key

I would be *VERY* grateful for any help in:

1. Recover the original file pw.tx. This file I remove in my shell and for me, it seems impossible to recover this file. Right? And I am sure: I have even a SSD on my 2018 MB Pro. Which makes it even much more improbable, to recover the decrypted pw-file.

2. If the file is mistakenly encrypted with wrong headers from perl.org <http://perl.org/>, perhaps it would be possible to change the headers to my private gpg key? I see in the pw.txt.gpg file <85> … <8c> … <91> which could be headers. If I replace some of them with a backup - two month old from a still working bu_pw.txt.pgg file?

3. As a last resort: is the private key of pause@pause.perl.org <mailto:pause@pause.perl.org> still in use? Would it possible to … ok ok private key … ok ok not possible … I understand.

Some ideas? Thank you for your insight


Marek Stepanek
Re: All my Passwords are lost [ In reply to ]
Did you encrypt to yourself as well as to the pause key for some reason?
Are you a pause admin? It sounds like you encrypted to both yourself and
pause@pause.perl.org for some reason. If that's the case and you cannot
find your private key, you could maybe ask a pause admin to decrypt and
re-encrypt to a key that you own, sending you back the encrypted file. But
you'd need to trust the pause admin with your passwords. I probably know
one that I would trust with this task, but it would put a bit of liability
risk on them as well...

On Sat, Apr 24, 2021, 15:00 Marek Stepanek <mstep@podiuminternational.org>
wrote:

> Hello all,
>
> Perhaps somebody out there could be of some help. I use since 10 years now
> GnuPG in my Shell to encrypt my Passwords. I only open this file, from time
> to time to look up some pws which I need for banking, crypto or to check,
> which of my many mails I used on which webpage.
>
> After use I remove the pw.txt file immediately with my shell. All what is
> left is the file pw.txt.gpg.
>
> Now after such a long time, something strange happened: this file is
> apparently encrypted with a foreign private key, which I never have had:
>
> gpg: WARNING: no command supplied. Trying to guess what you mean ...
> gpg: encrypted with 2048-bit ELG key, ID 1F1EF0849B5C6D50, created
> 2019-06-30
> "PAUSE Batch Signing Key 2021 <pause@pause.perl.org>"
> gpg: decryption failed: No secret key
>
> I would be *VERY* grateful for any help in:
>
> 1. Recover the original file pw.tx. This file I remove in my shell and for
> me, it seems impossible to recover this file. Right? And I am sure: I have
> even a SSD on my 2018 MB Pro. Which makes it even much more improbable, to
> recover the decrypted pw-file.
>
> 2. If the file is mistakenly encrypted with wrong headers from perl.org,
> perhaps it would be possible to change the headers to my private gpg key? I
> see in the pw.txt.gpg file <85> … <8c> … <91> which could be headers. If I
> replace some of them with a backup - two month old from a still working
> bu_pw.txt.pgg file?
>
> 3. As a last resort: is the private key of pause@pause.perl.org still in
> use? Would it possible to … ok ok private key … ok ok not possible … I
> understand.
>
> Some ideas? Thank you for your insight
>
>
> Marek Stepanek
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: All my Passwords are lost [ In reply to ]
On Sat, 24 Apr 2021 15:19:07 -0700, "C.J. Collier" <cjac@colliertech.org> wrote:
> you could maybe ask a pause admin to decrypt and
> re-encrypt to a key that you own, sending you back the encrypted file.

Two ideas from a gpg-internal *UN*aware point of view:
- I assume gpg file encryption works by generating a random symmetric
cipher key, encrypting the file with this symmetric cipher, and
only encrypting the symmetric cipher's key with the asymmetric cipher
public key.
If so, then the encrypted symmetric key could in theory (...again, I
do not know enough of gnupg internals) be extracted and be the only
thing sent for decryption and sent back deciphered.
Of course, it means that if the file was leaked encrypted, then this
deciphered key intercepted, then the file is completely leaked.
- Is the asymmetric algorithm transitive ? If it is, then again
starting from an extracted encrypted key, it could be encrypted again
with the good public key, then sent for decryption. The key received
back would still be encrypted by the good public key. It can then
finally be deciphered, allowing the symmetric cipher to decipher the data.
This would solve the plain-text vulnerability of the previous point.

I believe (again, not an expert) decryption and signature use different
parameters in gpg, so from the pause admin point of view they should
not be worried about inadvertently signing a hash, but actually
deciphering a symmetric key (which can otherwise be a concern).
--
Vincent Pelletier
GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: All my Passwords are lost [ In reply to ]
Hello all,

Thank you for your answers. Hope I respond to your questions:

I encrypt in my Shell as follows - I am doing it just now with a Backup File on my desktop:

$ gpg bu_pw_new.txt.gpg
gpg: WARNING: no command supplied. Trying to guess what you mean ...
gpg: encrypted with 2048-bit ELG key, ID F5FF48588C144291, created 2010-08-05
"Marek Stepanek <marek@munich-taxis.de>”

If I change something with VIM I make:

$ rm bu_pw_new.txt.gpg
$ gpg -e bu_pw_new.txt
You did not specify a user ID. (you may use "-r")

Current recipients:

Enter the user ID. End with an empty line: marek
gpg: F5FF48588C144291: There is no assurance this key belongs to the named user

sub elg2048/F5FF48588C144291 2010-08-05 Marek Stepanek <marek@munich-taxis.de>
Primary key fingerprint: B607 17A3 A754 8564 B209 6A9B D442 9D47 8F5D ABEF
Subkey fingerprint: 4CE5 48A1 9A35 DCD7 D18D 183B F5FF 4858 8C14 4291

It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes.

Use this key anyway? (y/N) y

Current recipients:
elg2048/F5FF48588C144291 2010-08-05 "Marek Stepanek <marek@munich-taxis.de>"

Enter the user ID. End with an empty line:

And here it is encrypted again. Then I remove the raw text file:

$ rm bu_pw_new.txt

I am unsure how GnuPG could pick up the wrong key, which does not exist in my key deposit. My guess is, that it is encrypted anyway with my private key, but the headers are mangled up??? For that reason my question was: may I replace some headers from my backup file ( two month old! ) into the spoiled one? But until where? For that reason I was posting here, to ask some of the developers how to achieve it right. There are plenty of those <85> … <8c> … <91> - cutting the binary file in some pieces (?)

Thank you Vincent for your detailed answer, which is way over my head. I really should look into the internals of file encryption one day …

Is pause@pause.perl.org <mailto:pause@pause.perl.org> listening? Is your PGP key still in use?

Best greetings to all


marek



> On 25. Apr 2021, at 10:41, Vincent Pelletier <plr.vincent@gmail.com> wrote:
>
> On Sat, 24 Apr 2021 15:19:07 -0700, "C.J. Collier" <cjac@colliertech.org> wrote:
>> you could maybe ask a pause admin to decrypt and
>> re-encrypt to a key that you own, sending you back the encrypted file.
>
> Two ideas from a gpg-internal *UN*aware point of view:
> - I assume gpg file encryption works by generating a random symmetric
> cipher key, encrypting the file with this symmetric cipher, and
> only encrypting the symmetric cipher's key with the asymmetric cipher
> public key.
> If so, then the encrypted symmetric key could in theory (...again, I
> do not know enough of gnupg internals) be extracted and be the only
> thing sent for decryption and sent back deciphered.
> Of course, it means that if the file was leaked encrypted, then this
> deciphered key intercepted, then the file is completely leaked.
> - Is the asymmetric algorithm transitive ? If it is, then again
> starting from an extracted encrypted key, it could be encrypted again
> with the good public key, then sent for decryption. The key received
> back would still be encrypted by the good public key. It can then
> finally be deciphered, allowing the symmetric cipher to decipher the data.
> This would solve the plain-text vulnerability of the previous point.
>
> I believe (again, not an expert) decryption and signature use different
> parameters in gpg, so from the pause admin point of view they should
> not be worried about inadvertently signing a hash, but actually
> deciphering a symmetric key (which can otherwise be a concern).
> --
> Vincent Pelletier
> GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1
>
Re: All my Passwords are lost [ In reply to ]
On 2021-04-25 at 08:41 +0000, Vincent Pelletier wrote:
> On Sat, 24 Apr 2021 15:19:07 -0700, "C.J. Collier" <cjac@colliertech.org> wrote:
> > you could maybe ask a pause admin to decrypt and
> > re-encrypt to a key that you own, sending you back the encrypted file.
>
> Two ideas from a gpg-internal *UN*aware point of view:
> - I assume gpg file encryption works by generating a random symmetric
> cipher key, encrypting the file with this symmetric cipher, and
> only encrypting the symmetric cipher's key with the asymmetric cipher
> public key.
> If so, then the encrypted symmetric key could in theory (...again, I
> do not know enough of gnupg internals) be extracted and be the only
> thing sent for decryption and sent back deciphered.

Yes, passing that key is even supported out-of-the box. See the
options:
--show-session-key
--override-session-key

The "encryption header" could be extracted with gpgsplit.


> I believe (again, not an expert) decryption and signature use
> different parameters in gpg, so from the pause admin point of view
> they should not be worried about inadvertently signing a hash, but
> actually deciphering a symmetric key (which can otherwise be a
> concern).

Yes. Their concern should be that maybe someone sent them a secret
message and is now trying to social engineer them with a story of
pw.txt.


Marek, didn't you make backups of this encrypted file? How did you plan
for the event that your hard disk broke?

Also, for the future, you may be interested in "gpg -d < pw.txt.gpg",
as well as pass (https://www.passwordstore.org/)


Cheers




_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: All my Passwords are lost [ In reply to ]
Hello Marek,

On Sun, 25 Apr 2021 17:31:53 +0200, Marek Stepanek <mstep@podiuminternational.org> wrote:
> I am unsure how GnuPG could pick up the wrong key, which does not exist in my key deposit. My guess is, that it is encrypted anyway with my private key

Beware of a possible misunderstanding here: encryption is done with the
*public* key. It is decryption which requires the private key. So you
can easily encrypt something with any of the (possibly many) public
keys from your key ring.

> Thank you Vincent for your detailed answer,

Welcome !

> which is way over my head.

Don't worry, I was tossing some ideas to maybe save you from disclosing
your entire file to someone else (by only exchanging the encrypted
session key rather than the whole file).
But I 100% deffer to anyone knowledgeable about gnupg itself for
whether anything I suggest is actually possible, and how to do it.

> I really should look into the internals of file encryption one day …

Besides on-line sources like wikipedia or youtube (computerphile
channel has several crypto-related videos), I found the following book
to be especially enlightening (...from a crypto-unrelated developer
perspective anyway):
https://www.schneier.com/books/cryptography-engineering/

Regards,
--
Vincent Pelletier
GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: All my Passwords are lost [ In reply to ]
Thank you Vincent,

I am really ashamed! Yes you are right: encryption is normally done with a public key. (I am blushing). I forgot, because nobody has a PGP-Key to correspond with. The only use for my own PGP-key was to encrypt my own Password-file, AND this with my private key, of course! Only for decrypting I need my (own) private key. Sorry to this mailing group, for this simplicity. But how did it happen? I encrypt always the same way: gpg -e pw.txt filling in my first name and hit <enter> twice.

That means, no way to fiddle around with the headers (I called them like that) of the pw.gpg-file. It is really encrypted with the PUBLIC key of pause@pause.perl.org <mailto:pause@pause.perl.org> - probably a dead email address - nobody is reading.

Don’t know what to do. The last month I started to invest into crypto-currency and some information are buried for ever in this gpg.file

Suppose Vincent you are French. Donc merci infiniment pour votre aide!


marek


> On 26. Apr 2021, at 13:12, Vincent Pelletier <plr.vincent@gmail.com> wrote:
>
> Hello Marek,
>
> On Sun, 25 Apr 2021 17:31:53 +0200, Marek Stepanek <mstep@podiuminternational.org> wrote:
>> I am unsure how GnuPG could pick up the wrong key, which does not exist in my key deposit. My guess is, that it is encrypted anyway with my private key
>
> Beware of a possible misunderstanding here: encryption is done with the
> *public* key. It is decryption which requires the private key. So you
> can easily encrypt something with any of the (possibly many) public
> keys from your key ring.
>
>> Thank you Vincent for your detailed answer,
>
> Welcome !
>
>> which is way over my head.
>
> Don't worry, I was tossing some ideas to maybe save you from disclosing
> your entire file to someone else (by only exchanging the encrypted
> session key rather than the whole file).
> But I 100% deffer to anyone knowledgeable about gnupg itself for
> whether anything I suggest is actually possible, and how to do it.
>
>> I really should look into the internals of file encryption one day …
>
> Besides on-line sources like wikipedia or youtube (computerphile
> channel has several crypto-related videos), I found the following book
> to be especially enlightening (...from a crypto-unrelated developer
> perspective anyway):
> https://www.schneier.com/books/cryptography-engineering/
>
> Regards,
> --
> Vincent Pelletier
> GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1
>
Re: All my Passwords are lost [ In reply to ]
On Tue, 27 Apr 2021 20:32:04 +0200, Marek Stepanek <mstep@podiuminternational.org> wrote:
> That means, no way to fiddle around with the headers (I called them like that) of the pw.gpg-file.

BTW, I just noticed that there was an on-list-only email which gave
details on how to extract and replace-during-decryption these, so in
case you are not subscribed and missed it, here it is:
https://lists.archive.carbon60.com/gnupg/users/90299#90299
(first result on "gnupg-user archives", no idea about the quality of
this archive domain in particular)

Also, I had a completely different idea to how to maybe retrieve the
file: as you decrypt it on-disk before use, maybe you can recover it by
undeleting this file ? This is of course:
- very dependent on the filesystem (I believe not all have tools for
undeleting)
- very dependent on the amount of writes which happened since the last
deletion (compared to the amount of free space)
- very dependent on whether this is on an ssd and whether you have
"discard" enabled
- possibly tedious, depending on the capabilities of the tool used to
undelete
but at least this is a way which puts crypto out of the equation.

And on a related note: is there an RAM-only (ideally swap-disabled, no
temporary file...) decipher-edit-encipher editor out there, to avoid
having to write plain files to disk and leaving such traces ? I thought
kleopatra did this, but I cannot find it now.

> It is really encrypted with the PUBLIC key of pause@pause.perl.org <mailto:pause@pause.perl.org> - probably a dead email address - nobody is reading.

Maybe you can try to reach out someone else on the perl.org domain, who
may guide you to someone having access to that key ?

Regards,
--
Vincent Pelletier
GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: All my Passwords are lost [ In reply to ]
On Montag, 3. Mai 2021 02:27:12 CEST Vincent Pelletier via Gnupg-users wrote:
> And on a related note: is there an RAM-only (ideally swap-disabled, no
> temporary file...) decipher-edit-encipher editor out there, to avoid
> having to write plain files to disk and leaving such traces ? I thought
> kleopatra did this, but I cannot find it now.

Kleopatra has a notepad which allows this. It doesn't prevent swaping, but it
does not write anything to disk itself.

Regards,
Ingo