sharpcompress icon indicating copy to clipboard operation
sharpcompress copied to clipboard

Create password protected archives

Open sepehr1014 opened this issue 9 years ago • 14 comments

How can we set password when creating archives?

sepehr1014 avatar May 31 '15 16:05 sepehr1014

If this can't be done, can you point out which parts need to be modified in order to implement this feature?

sepehr1014 avatar Jun 18 '15 08:06 sepehr1014

@adamhathcock It seems this project is not actively maintained. We're working on a big project and we had plans to use SharpCompress as part of it ...

sepehr1014 avatar Jul 07 '15 10:07 sepehr1014

I'm still here but I'm not actively working on it. Others have contributed and asked questions and I try to answer them. However, my focus is elsewhere at the moment.

As far as creating passwords, you'd probably want to modify the WriterFactory, as a starting point, to take the password. Then implement it on ZipWriter or other writers. Then the ArchiveFactory would do the same.

adamhathcock avatar Jul 07 '15 10:07 adamhathcock

I just reviewed the code. As far as I understand it is a matter of using PkwareTraditionalCryptoStream in the streams chain for writing data. It is, of course, if that class is fully implemented for encryption. I see this question was asked long ago. I need this too. Did somebody already did it or started doing it? I'm thinking about implementing this part but I would like to avoid double work and reuse what's already done but not added to the project. Please, let me know.

alex4998 avatar Sep 23 '16 03:09 alex4998

I doubt anyone is working on it. Please do and submit a pull request :)

adamhathcock avatar Sep 23 '16 16:09 adamhathcock

Has there been any progress on this? I would need this feature....

dos-ise avatar Jul 17 '17 08:07 dos-ise

You’re welcome to add it yourself.

adamhathcock avatar Jul 17 '17 11:07 adamhathcock

I have tried something. But having problems with the encryption data :/ You can take a look at it under -> Commit 2482769e

dos-ise avatar Jul 17 '17 14:07 dos-ise

Did you take a look at my commit?

dos-ise avatar Jul 26 '17 10:07 dos-ise

I didn't because I'm on vacation and I have no idea how to view whatever you're referring to.

Please, make a pull request if you have something for review.

adamhathcock avatar Jul 26 '17 12:07 adamhathcock

Forget that :)

dos-ise avatar Jul 27 '17 12:07 dos-ise

Sorry, I would really like a diff. Pull Requests do work with a proper fork of the repo.

adamhathcock avatar Jul 27 '17 12:07 adamhathcock

https://github.com/adamhathcock/sharpcompress/pull/284

now it has worked ^^ I'm just stupid :)

dos-ise avatar Jul 27 '17 13:07 dos-ise

Is there any problem on the zip_encryption branch? Perhaps I can look into it.

Looooong avatar Mar 18 '21 14:03 Looooong