Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] Encountered OpenPGP Exception during operation! #2886

Open
christ4k opened this issue Feb 21, 2024 · 13 comments
Open

[ERROR] Encountered OpenPGP Exception during operation! #2886

christ4k opened this issue Feb 21, 2024 · 13 comments

Comments

@christ4k
Copy link

I have a GPG key on my computer. The key consists of:

  • The primary key which is exported on a removable media (the secret part of course)
  • RSA encryption key
  • RSA signing key
  • cv25519 encryption key
  • ed25519 authentication key
  • another ed25519 authentication key

The authentication keys are irrelevant to the problem, I'm just mentioning their existence.

I also have installed pass. I have initialized my password store with the RSA encryption key and the cv25519 encryption key.

Furthermore, I exported the secret subkey (cv25519) with the following command in order to import it in OpenKeyChain to be able to decrypt passwords to my phone.
gpg -o android.gpg --export-secret-subkeys 0xKEY_ID!

I then imported the key into OpenKeyChain and going to advanced settings of the key, I see that the primary key is characterized as stripped (because the secret part is missing), but the subkey responsible for the decryption looks normal.

Expected Behavior

Tap on a password through password store, prompt me to allow password store to use OpenKeyChain to decrypt the password, provide the password and see the decrypted text.

Current Behavior

I tried decrypting a password of mine and the error I'm getting is:
Encountered OpenPGP Exception during operation!
I then copied an encrypted password manually to the storage of the phone and tried decrypting through the openkeychain app directly (instead of using the password store). The error is the same. I exported the log, but this is all it says:

[START] Processing input data
 [DEBUG] Attempting to process OpenPGP data
  [ERROR] Encountered OpenPGP Exception during operation!

Steps to Reproduce (for bugs)

Steps for reproducing are described above

Context

I cannot use password store as I am using the last 3 years and been completely satisfied. 😢

Your Environment

  • Android Version: 13 (Lineage OS 20)
  • Device Model: Oneplus Nord (AC2003)
  • OpenKeychain Version: 6.0.0
  • From Google Play or F-Droid?: F-Droid
@rafaelazvdo
Copy link

Is it just a single subkey for signing?

@christ4k
Copy link
Author

Is it just a single subkey for signing?

It's an encryption subkey the one that I exported to my phone.

@Valodim
Copy link
Member

Valodim commented Feb 21, 2024

Please update to 6.0.2, that might already fix your problem. I'm not sure what's happening precisely, but I'd rather not chase ghosts just to find we fixed the issue before ;)

Also, does the decryption work if you just encrypt some text to your key via OpenKeychain?

@rafaelazvdo
Copy link

@Valodim How do you update? I didn't find the .apk for version 6.0.2.

@Valodim
Copy link
Member

Valodim commented Feb 21, 2024

seems fdroid is still building it 🤷 https://gitlab.com/fdroid/fdroiddata/-/issues/3197

@christ4k
Copy link
Author

Please update to 6.0.2, that might already fix your problem. I'm not sure what's happening precisely, but I'd rather not chase ghosts just to find we fixed the issue before ;)

Also, does the decryption work if you just encrypt some text to your key via OpenKeychain?

Today I tried the new version 6.0.2 (was waiting to be built on fdroid) but I have the same problem.

I tried encrypting and decrypting just plain text and it works.

@flowthentic
Copy link

I encountered this problem already more than a year ago, when I upgraded a key version - later I opened the issue.

Today I tried to reencrypt all of them with the new cv25519/ed25519 key pair, but I have the same problem. I couldn't fix the problem even with an old RSA keys.

@flowthentic
Copy link

I have found the solution in the following comment.

After disabling the non-compliant AEAD mechanism, I had to reencrypt all the passwords, only after that OpenKeyChain can decrypt them.

@zanzara
Copy link

zanzara commented Mar 1, 2024

when will be 6.0.4 updated to F-Droid?

@christ4k
Copy link
Author

christ4k commented Mar 1, 2024

I have found the solution in the following comment.

After disabling the non-compliant AEAD mechanism, I had to reencrypt all the passwords, only after that OpenKeyChain can decrypt them.

If I'm wrong, please feel free to correct me. The AHEAD mechanism is a mechanism providing extra security on top of symmetric encryption. So while backwards compatibility is important, it should not come at the expense of security. I'll probably wait until this feature is added and then use it again.

@yescallop
Copy link

I have also encountered the same error with OpenKeychain 6.0.4, with the same log output:

[START] Processing input data
 [DEBUG] Attempting to process OpenPGP data
  [ERROR] Encountered OpenPGP Exception during operation!

Here are the steps to reproduce the error:

  • Import the following private key into OpenKeychain. This key is generated with Kleopatra 3.2.0 and GnuPG 2.4.4 on Windows 11 with default settings except that the expiration date is unset.
-----BEGIN PGP PRIVATE KEY BLOCK-----

lFgEZeKfURYJKwYBBAHaRw8BAQdAZvooz6PIfVz37v9ByYXtjVuoC3dKnEGeImVL
CgIP3/8AAQDTx7Qqorl0i+Zn6AnyaLnjstQVlkT6hHg0rO8szp+8MhLItARUZXN0
iJMEExYKADsWIQRo4hutpS5nndP7Qgcda22HODhQvAUCZeKfUQIbAwULCQgHAgIi
AgYVCgkICwIEFgIDAQIeBwIXgAAKCRAda22HODhQvEZbAQCHQnyJkpPtvj3tF43r
UTEGP8ezsrdTaKZwtLxYgOqPbAEA5tgUEL6OqsLKMu70qJeHX68dXrSRIHH3Qhqp
eCAcyAycXQRl4p9REgorBgEEAZdVAQUBAQdAAZ6PxGkBrWcvNzeYzW1ThlCwToih
rvQXP3fUsrL98woDAQgHAAD/Qh40/yTfv4NmlVR8FzxO/JzBGl3IbjHkj/m9+Z1T
PuARqoh4BBgWCgAgFiEEaOIbraUuZ53T+0IHHWtthzg4ULwFAmXin1ECGwwACgkQ
HWtthzg4ULzDnAD9EauLGcv2kUNl0skzNR6S3SNFNB19y5LcTwRONd6yXhkA+wdH
9oKIRJEIrxmx+hVspuZ8BpyYsh6zK3hxHOEDR2UF
=0GDt
-----END PGP PRIVATE KEY BLOCK-----
  • Copy the following message and use OpenKeychain to decrypt from clipboard. This message is encrypted with the same tools as above.
-----BEGIN PGP MESSAGE-----

hF4DRy+xKOPeqnoSAQdAln5TsrYsGyzFmqsSKACrHjz+EdkmqXZxy7HUL+5l/mcw
3NmHM3rQsSjk+SJWu8erQ5gzOWME0OyaHpF4XT6eHt3F7v3sHFbi7pE+L69aPxCI
1D8BCQIQTcpciIHM5e4218/lVV1l5EqRvTSzuv8q57WSfPw1Sw61HdfedSPluSZI
YKM/C7RQgIS0bpGHecMjvKA=
=MBAD
-----END PGP MESSAGE-----

@Valodim Could you take a look at this when you have time?

@l3u
Copy link

l3u commented Mar 3, 2024

I ran into this exact problem after having generated a new ECC/ED25519 key with GnuPG 2.4.4 and re-encrypting my pass password store with it: Pass can't decrypt anything anymore due to "Encountered OpenPGP Exception during operation!".

It would be really cool if this was fixed/added, as the standard keys that GnuPG creates can't be used with Android pass and OpenKeychain at the moment …

@Jimmy2027
Copy link

having the same issue, see related post on andoird-password-store

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants