0 votes
by (160 points)
edited

Hi,

we created a zip archive with aes256 encryption and a password with special chars like €,ü,ö etc. It creates the zip correctly but if you then want to unzip the file with winrar or winzip it always says wrong password.
Seems like a encoding issue.


Is there any workaround.


Here is the source code in c#


 using (ZipArchive zip = new ZipArchive(ZipFileToCreate, ArchiveOpenMode.Create))
{
// set the Password first
zip.Password = "tüst";
//zip.Password = "€urope";
// optionally change the default Encryption algorithm
zip.EncryptionAlgorithm =EncryptionAlgorithm.Aes256; // now add files zip.Add(FileToZip); }

Applies to: Rebex ZIP

2 Answers

0 votes
by (15.2k points)
edited

Hi,

AES-256 encryption is implemented according to WinZip encryption specification, which uses RFC2898 to generate key from password. Unfortunately, WinZip does not specify an encoding to use. As suggested in RFC2898 we use UTF-8 encoding.

It seems that WinZip chose to use windows-1252 encoding. Unfortunately, there is no workaround for this issue.

Would you like to send fixed trial version? Or if you have bought Rebex ZIP, you can send us order details and we can send you full version with the fix.

by (160 points)
edited

Hi,

thank you for your answer. Yes if it is possible to send me a fixed trial version, this would be great. So I can evaluate further.

Thank you very much. Best regards, Mark

by (72.7k points)
edited

You can download current BETA TRIAL version here.

Alternatively, download only binaries (without installer) here.

New version uses encoding Windows-1252 by default now. You can set custom encoding by ZipArchive.Options.PasswordEncoding. If a password cannot be encoded using given encoding an exception is thrown.

by (140 points)
Hi,

I have the same problem.
What is the correct syntax for "ZipArchive.Options.PasswordEncoding"? How values are possible?

Thanks...

Peter
by (147k points)
0 votes
by (160 points)
edited

Hi,

thank you very much. It is working perfectly. If we buy the library, we then just have to replace the demo key with the new given key, or?

Thank you Best regards

by (58.9k points)
edited

Hello,

when you buy the library there is no full version key. Simply discard the trial key setter line from your program and change the references from the trial ones to the new full version dlls you obtain from Rebex and that's it.

As the beta has not been released officially yet, so once you buy the Rebex ZIP for .NET, please write us from your registered email to support@rebex.net and we will send the full version of the beta back to you.

...