mattosaurus / PgpCore

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

Size differences between files encrypted with PGPCore and files encrypted with PGP command line #248

Closed MB34 closed 1 year ago

MB34 commented 1 year ago

We have noticed that the files that are encrypted using PGPCore are significantly larger than files encrypted with command line PGP.

For a 22KB (22,304 bytes) file, the encrypted file size for one encrypted by command line PGP is 7.98KB (8,178 bytes) But the exact same file encrypted using PGPCore is 78.2KB (80,087 bytes)

Can you explain this ten fold increase in file size?

mattosaurus commented 1 year ago

It's probably because PGP is compressing the message and the PGPCore default is not to compress it.

https://github.com/mattosaurus/PgpCore#compressionalgorithm

There may also be a difference in armoured vs binary output.

MB34 commented 1 year ago

Well, how do I change the CompressionAlgorithm?

mattosaurus commented 1 year ago

https://github.com/mattosaurus/PgpCore/blob/82987094eec5f0f4d8856595a3083eb0257442ff/PgpCore.Tests/UnitTests/UnitTestsAsync.cs#L565-L598

MB34 commented 1 year ago

THX, Got it working