bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

Addition of AEAD Encrypted Data Packet (Tag 20)

Open jamiepetergaunt opened this issue 2 years ago • 10 comments

Org.BouncyCastle.Bcpg.PacketTag needs the new 20 tag for AEAD.

jamiepetergaunt avatar Oct 26 '23 11:10 jamiepetergaunt

Generating a new default key with Gpg and encrypting a file, produces a PGP file that crashes with PgpCore (due to it's dependency on BouncyCastle.Cryptography). The message is:

System.Private.CoreLib: Exception while executing function: DecryptPgpBlob. BouncyCastle.Cryptography: unknown packet type encountered: 20.

I suspect this comes from the method ReadPacket in BcpgInputStream, but I am hesitant to make a PR to this library myself, since I am not familiar with it's workings.

Let me know, if I can assist in any way in getting this implemented.

magnusakselvoll avatar Nov 27 '23 10:11 magnusakselvoll

Maybe there is a "special" way to decrypt and verify data when AEAD is present. By PgpCore, you can check how the decrypt method is here : https://github.com/mattosaurus/PgpCore/blob/master/PgpCore/PGP.DecryptAsync.cs (from 198)

But it is weird because if I check the last release notes : AEAD is managed.

I updated the PgpCore ticket too.

BaptX-dev avatar Dec 21 '23 13:12 BaptX-dev

Are there any solutions available for this issue? I'm encountering the same error

nikhilvc avatar Jun 12 '24 14:06 nikhilvc

Getting this same error. Doesn't look like bouncy castle has a solution for files encrypted with AEAD keys.

swestoverfeb avatar Jun 12 '24 15:06 swestoverfeb