GithubHelp home page GithubHelp logo

Comments (11)

JasonFossen avatar JasonFossen commented on May 23, 2024 1

Yes, that would be great, maybe "-EncryptFileNames" so that the name of the switch matches the name of the checkbox in the 7-Zip GUI?

Btw, do you have a PayPal.me quick link or e-mail address for small thank-you donations?

Thanks!

from 7zip4powershell.

JasonFossen avatar JasonFossen commented on May 23, 2024 1

Btw, with the new -EncryptFilenames switch, I wrote a blog article on it:

https://cyber-defense.sans.org/blog/2016/06/06/powershell-7-zip-compress-archive-encryption

from 7zip4powershell.

thoemmi avatar thoemmi commented on May 23, 2024

Thank you for your kind words.

Regarding your request: Neither ZIP nor 7-ZIP encrypt the filenames, only the content. It's in the specification, so there's nothing I can do about it.

from 7zip4powershell.

JasonFossen avatar JasonFossen commented on May 23, 2024

My fault, I should have mentioned, this request was only for the 7z format. So, for example, if you highlight a bunch of files in Windows File Explorer > right-click > select 7-Zip > Add to Archive > select the 7z format > then there is a checkbox to "Encrypt file names". When the 7z archive is created, the names of the files in the 7z file cannot be seen until after the password is entered. For your cmdlet, it would only apply when doing "Compress-7Zip -Format SevenZip ...".

from 7zip4powershell.

thoemmi avatar thoemmi commented on May 23, 2024

Ok, I see. Is it the same as the custom parameter he=on? Then you should be able to set it in the init scriptblock:

$initScript = {
    param ($compressor)
    $compressor.CustomParameters.Add("he", "on")
}

Compress-7Zip -Format SevenZip -CustomInitialization $initScript ...

from 7zip4powershell.

JasonFossen avatar JasonFossen commented on May 23, 2024

Yes, thank you, that $initscript did it. So, the request is: When "-Format SevenZip" and "-Password anything", can "he=on" be the default? I think this is what users are more likely to expect when encrypting archives, it's definitely more secure, and it would still leave the option of setting "he=off" with a custom init when plaintext file names is specifically wanted for some reason. Thanks

from 7zip4powershell.

thoemmi avatar thoemmi commented on May 23, 2024

7-Zip does not encrypt filenames by default, therefore I wouldn't like to enable it automatically. If someone uses 7z for encryption he has to enable the encryption explicitly, and the Powershell module should behave the same.

What I can offer is to add an -EncryptHeader switch for convenience. Are you fine with that?

from 7zip4powershell.

thoemmi avatar thoemmi commented on May 23, 2024

Ok, I'll go with EncryptFilenames.

Thanks for your appreciation. Nope, I don't have a PayPal.me account. I'm doing this for fun and to serve my own needs. If others benefit from my code too it's great. I have to thank you for requesting this feature. It makes 7Zip4Powershell better and may help others as well.

from 7zip4powershell.

thoemmi avatar thoemmi commented on May 23, 2024

Jason, -EncryptFilenames is supported by the new release v1.5, which should by available in the PSGallery by now.

from 7zip4powershell.

thoemmi avatar thoemmi commented on May 23, 2024

Great article. Do you mind if I add a link to it from the readme?

from 7zip4powershell.

JasonFossen avatar JasonFossen commented on May 23, 2024

Sure, I hope it helps get the word out. :-)

from 7zip4powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.