Solved

Remove Password from WinRAR via .NET

Posted on 2013-05-21
6
1,126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

732 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