mattosaurus / PgpCore

.NET Core class library for using PGP
MIT License
244 stars 98 forks source link

Decrypting zero-byte files #293

Open Budsy opened 4 months ago

Budsy commented 4 months ago

With version 6.3.1 attemptying to decrypt an empty file will cause an exception. I haven't checked versions later than this. I get outside parties sending me empty files from time to time. Maybe the decryptor could just write out an empty file when it encounters these.

mattosaurus commented 4 months ago

Hi, thanks for raising this issue. I'll take a look next week. Writing out an empty file sounds like a good solution.

mattosaurus commented 4 months ago

So I've created a PR to add some tests for encrypting/decrypting empty messages and they work as expected.

https://github.com/mattosaurus/PgpCore/pull/294

Just to clarify, your issue is that you have a .pgp file with no content at all, rather than an encrypted empty string?