Solved

Remove Password from WinRAR via .NET

Posted on 2013-05-21
6
1,003 Views
Last Modified: 2013-05-22
Does anyone know a library I can use for a .NET application where I can essentially remove passwords from WinRAR files?

Unfortunately the following libraries only unrar the files, whereas I only need to remove the password and leave the archive file intact:
- DotNetZip
- SevenZipSharp
0
Comment
Question by:Cmitch
6 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
I doubt that that is possible.  If it were, that would be a MAJOR security flaw.

AW
0
 
LVL 38

Expert Comment

by:PaulHews
Comment Utility
If you possess the password then you must extract the contents and re-archive them without the password protection.  You can do this with WinRAR by executing it on the command line, and we can potentially help with that.

If you don't possess the password, then you are out of luck.  WinRAR 3 employs solid encryption.  RAR password retrieval/removal tools fall into two categories:  brute force and scams.
0
 
LVL 16

Expert Comment

by:Stephan
Comment Utility
Do you have the password of the archives?
If you don't have those, it's impossible.

If you have them, there is a library that can remove it:
http://xceed.com/Zip_Net_Features.html
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
Comment Utility
if you don't have password then Bed luck.

you can not direct remove password from rar file you have to extract it and recreate rar file.

No RAR Creation library available in market. you can create RAR file using WinRAR or RAR.
0
 

Author Comment

by:Cmitch
Comment Utility
Just to clarify I do have the password for the archive file in question.  However we have a large amount of archive files with the same password,  hence why this solution is required.
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 500 total points
Comment Utility
As I previously mentioned, executing WinRAR on the command line:

    Private Sub RemovePassword(Filename As String, Password As String)
        Dim WinrarPath As String = "C:\Program Files\WinRAR\WinRAR.exe" 'Could put in configuration.
        Dim ExtractCmd As String = String.Format("X -p{0} *.* C:\temp\extract\", Password)

        Dim p = Process.Start(WinrarPath, ExtractCmd)
        p.WaitForExit()
        'Rename old rar file as .old
        IO.File.Move(Filename, Filename & ".old")

        Dim RecreateCmd As String = String.Format("A ""{0}"" C:\temp\extract\*.* -ep1", Filename)
        p = Process.Start(WinrarPath, RecreateCmd)
        p.WaitForExit()


    End Sub

Open in new window

Obviously you will have to adjust any hardcoded paths for your own use.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now