mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-04-05 21:51:09 +00:00
Rar password length #159
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arthurdaily on GitHub (Mar 15, 2017).
I'm having a problem with the password when uncompressing rar files.
If I use the password "1234567890123456789012345678" it works. If I then create a rar file with one extra char on the password "12345678901234567890123456789" , it still unpacks but the uncompressed file is garbage.
using (Stream stream = File.OpenRead(rarFilePath))
using (var reader = ReaderFactory.Open(stream, new ReaderOptions()
{
Password = _password,
LookForHeader = true
}))
{
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
Console.WriteLine(reader.Entry.Key);
reader.WriteEntryToDirectory(@"C:\rar\Uncompressed" + Path.GetFileNameWithoutExtension(rarFilePath), new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
}
}
@adamhathcock commented on GitHub (Mar 15, 2017):
Do you have a sample file with a password that works with WinRAR but not sharpcompress?
@arthurdaily commented on GitHub (Mar 15, 2017):
It won't allow me to attach a .rar file so I have zipped the rar file without a password.
The rar password: fdsa8789$sfd09a8sf8al0!qerwchas
PasswordTest.zip
@HamzaHizam commented on GitHub (Apr 28, 2017):
In my case I cant Extract RAR file with password at all.
The error is in --new ReaderOptions()-- and said
Error 2 The type or namespace name 'ReaderOptions' could not be found (are you missing a using directive or an assembly reference?) C:\Users\hamza\Documents\Visual Studio 2008\Projects\TryToUnRarfiFles\TryToUnRarfiFles\Form1.cs 130 64 TryToUnRarfiFles
...
Please if any one can help me ...