Coder Social home page Coder Social logo

check .7z is encrypted about lzmasdkobjc HOT 3 CLOSED

yangyu2010 avatar yangyu2010 commented on June 26, 2024
check .7z is encrypted

from lzmasdkobjc.

Comments (3)

OlehKulykov avatar OlehKulykov commented on June 26, 2024

Hi,
the quick answer is to listen password callback and forget about sure that the file has a password.
Because, the internal logic will ask user/user code for the password when it's needed and if it's needed.
Otherwise, the whole concept of password protected archive is gone when it's written/stored somehow inside the file :)
Also, keep in mind that archived may have encrypted header, i.e. the list of file, so you can't even see the list of files before first access.
For the reference, how the encrypted archives works, you can check the behavior the console 7za utility to check when the logic prompts the password, i.e. never, before opening and listing the file content or before extracting the first file.

So, if behavior of the archiver is not fits for your needs, just do not use such logic to avoid wrong app architecture.

Or, open archive and extract items in a separate thread and when the original SDK will ask the password, suspend an execution thread, display password prompt in a UI thread and then resume execution thread with user provided password.

from lzmasdkobjc.

yangyu2010 avatar yangyu2010 commented on June 26, 2024

@OlehKulykov
Hi,
Thank you for your detailed explanation.I understand what you mean, thank you very much.
I have another question I would like to ask you.If you like, I am very happy to know your thoughts.

My need is to compress large files. Use 7z volume archive.
For example, I have a 100 MB file and want to break it down into two 7z files.
My idea is to convert the file to NSData. Then use 7z compression.

- (BOOL) addData:(nonnull NSData *) data forPath:(nonnull NSString *) path;

I look forward to your answer.

from lzmasdkobjc.

OlehKulykov avatar OlehKulykov commented on June 26, 2024

Hi,
unfortunately split handler is not ported and was not even planned for a mobile platform, due to multiple write output and reader input. But thanks for the good idea, I'll keep in mind...
So, in this case I would like to recommend to:

  1. Archive single big file and then split output 7z file into few small parts.
  2. Read single big file into few small NSData's and archive each part individually into few 7z's archives.

P.S.: for a big input files, it's better to use - (BOOL) addPath:(nonnull NSString *) aPath forPath:(nonnull NSString *) path; method instead of keeping all in memory.

from lzmasdkobjc.

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.