?
Solved

Remove Password from WinRAR via .NET

Posted on 2013-05-21
6
Medium Priority
?
1,181 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
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 
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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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