ArgumentNullException is thrown if we use AESKeySize = 256. 128 does work
See original GitHub issueSteps to reproduce
- Install SharpZipLib.NETStandard on a Xamarin Android Project
- Execute:
private static async Task AddRawContentToZipAsync(ZipOutputStream zipStream, byte[] rawContent, string fileName) {
var file = new ZipEntry(fileName) { AESKeySize = 256, Size = rawContent.Length };
zipStream.PutNextEntry(file); -> EXCEPTION THROWN
await zipStream.WriteAsync(rawContent, 0, rawContent.Length);
zipStream.CloseEntry();
}
Expected behavior
Any Exception should be thrown
Actual behavior
An ArgumentNullException is thrown if we use AESKeySize = 256 after we call “zipStream.PutNextEntry()”. It works with AESKeySize = 128
Version of SharpZipLib
1.0.7
Obtained from (only keep the relevant lines)
- Package installed using NuGet
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Using AES encryption in C# - Stack Overflow
I can 't seem to find a nice clean example of using AES 128 bit encryption. Does anyone have some sample code? c#...
Read more >C# AES Encryption
You 're obtaining more than 20 bytes from PBKDF2-HMAC-SHA-1 and the attacker doesn't need the data from the second block (12 IV bytes), ......
Read more >How to Handle the ArgumentNullException in C# | Rollbar
The ArgumentNullException occurs in C# when null arguments are passed to a method in that expects non-null values.
Read more >Does .NET framework support AES-256 CTR mode?
I 've implemented this code snippet to try to encrypt and decrypt an array of bytes, with great success. However, the requirement and...
Read more >How to create AES encryption 256 bit key in C#
Encrypt the key with an asymmetric key and save it in a datastore: You can store the AES key in a database only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems to work with SharpZipLib, indeed! :Thank you very much! 👍 😃
Yes, the issue summary actually contains the row
Try using the latest “SharpZipLib” package (v1.2.0)