bcgit / bc-csharp

BouncyCastle.NET Cryptography Library (Mirror)
https://www.bouncycastle.org/csharp
MIT License
1.65k stars 552 forks source link

Addition of AEAD Encrypted Data Packet (Tag 20) #497

Open jamiepetergaunt opened 11 months ago

jamiepetergaunt commented 11 months ago

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

magnusakselvoll commented 10 months ago

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.

BaptX-dev commented 9 months ago

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.

nikhilvc commented 3 months ago

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

swestoverfeb commented 3 months ago

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