Solved

Remove Password from WinRAR via .NET

Posted on 2013-05-21
6
1,067 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
ID: 39187503
I doubt that that is possible.  If it were, that would be a MAJOR security flaw.

AW
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 39187566
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
ID: 39187567
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 39187575
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
ID: 39189453
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
ID: 39189506
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

837 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