Solved

Remove Password from WinRAR via .NET

Posted on 2013-05-21
6
1,033 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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

816 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

10 Experts available now in Live!

Get 1:1 Help Now