Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i unrar with password #40

Closed
xiamaoxuan opened this issue May 29, 2020 · 11 comments
Closed

how can i unrar with password #40

xiamaoxuan opened this issue May 29, 2020 · 11 comments

Comments

@xiamaoxuan
Copy link

how can i unrar with password

@sunny-shu
Copy link
Contributor

@beothorn
i read the code,it is not supported yet, am i right?

@beothorn
Copy link
Contributor

Yes, not supported. Looking at the code we just print
"archive is encrypted cannot extract"
and exit

@sunny-shu
Copy link
Contributor

sunny-shu commented Jul 20, 2020

@gotson @beothorn
i plan to work on this issue this week, i will do it based on the source code of winrar. Is there anything i need to pay attention to

@beothorn
by the way ,is the code of this project is based on the source code of winrar.I read the code of winrar and I found that the two are very similar

@gotson
Copy link
Member

gotson commented Jul 20, 2020

It seems someone already did it in one of the fork, check here koroshiya/junrar@06bdd47

Maybe you can port the changes.

And yes the code is a port of the C code.

@sunny-shu
Copy link
Contributor

sunny-shu commented Jul 21, 2020

i am working on it. koroshiya/junrar is not based on the latest code,so It may take a few days to resolve this matter。

the feature is a fake,I found that his code was not executed.it is amazing that it can still run normally。
I'm still analyzing his code,when the feature is ready,i will push a PR.

@gotson
Copy link
Member

gotson commented Jul 21, 2020

i am working on it. koroshiya/junrar is not based on the latest code,so It may take a few days to resolve this matter。

the feature is a fake,I found that his code was not executed.it is amazing that it can still run normally。
I'm still analyzing his code,when the feature is ready,i will push a PR.

I didn't test his fork yet, but i noticed it was using gnu crypto for the Rijndael algorithm (which is not implemented in our version). The jar is added directly in the project, which is bad practice. It seems the jar is available on Maven Central, but the project seems abandoned since 2014.

A good replacement could be Bouncy Castle, which is a well-known crypto library for Java.

@gotson
Copy link
Member

gotson commented Jul 21, 2020

the feature is a fake,I found that his code was not executed

I don't agree, i have tested it, and i found it can:

  • list content of encrypted files, which is not possible in our version because the file listing is encrypted
  • extract password protected files

However, i couldn't extract files from an encrypted archive, i get a CRC error.

@sunny-shu
Copy link
Contributor

hi gotson,I found the key point in koroshiya/junrar.now i unpack the encrypted successfully.
Next, I will replace gnu crypto according to your opinion and add the test case。
After all problems are solved, I will raise PR。
thank you for your advice.

@sunny-shu
Copy link
Contributor

hi gotson,the api of Rijndael is different from the JDK.
I tried many times with jdk's api,It cannot decrypt correctly。
I integrated the original author's code,You do the rectification for Rijndael. is that ok?

@gotson
Copy link
Member

gotson commented Jul 22, 2020

You can make a PR, I'll have a look, thanks!

@gotson gotson closed this as completed in 4402afc Jul 25, 2020
gotson pushed a commit that referenced this issue Jul 25, 2020
# [7.0.0](v6.0.1...v7.0.0) (2020-07-25)

### Code Refactoring

* cleanup public entry points ([70499bb](70499bb))
* move Volume classes to volume package ([c2405e0](c2405e0))
* simplify IO ([b59fc78](b59fc78))

### Features

* add password parameter for inputstream archives ([b218bb9](b218bb9))
* check if archive is password protected ([c1b7728](c1b7728))
* support for password protected archives ([4402afc](4402afc)), closes [#48](#48) [#40](#40)

### BREAKING CHANGES

* public API changed
* public API changed
* name of classes have changed
@gotson
Copy link
Member

gotson commented Jul 25, 2020

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants