Rar password length #159

Open
opened 2026-01-29 22:07:34 +00:00 by claunia · 3 comments
Owner

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
});
}
}
}

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 }); } } }
Author
Owner

@adamhathcock commented on GitHub (Mar 15, 2017):

Do you have a sample file with a password that works with WinRAR but not sharpcompress?

@adamhathcock commented on GitHub (Mar 15, 2017): Do you have a sample file with a password that works with WinRAR but not sharpcompress?
Author
Owner

@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

@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](https://github.com/adamhathcock/sharpcompress/files/844662/PasswordTest.zip)
Author
Owner

@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 ...

@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 ...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#159