Lazarus

Using the Lazarus IDE => General => Topic started by: viterik on March 02, 2023, 07:58:26 pm

Title: How to set a password for the archive? paszlib TZipper
Post by: viterik on March 02, 2023, 07:58:26 pm
Please tell me. How to set a password for the archive? I use this library
https://fpcwiki.coderetro.net/paszlib/ (https://fpcwiki.coderetro.net/paszlib/ru)

Code: Pascal  [Select][+][-]
  1. Uses ...Zipper,FileUtil
  2. var
  3.   AZipper: TZipper;
  4.   TheFileList:TStringList;
  5. begin
  6.   MyDirectory:='C:\MyFolder';
  7.   AZipper := TZipper.Create;
  8.   AZipper.Filename := 'myzipfile.zip';
  9.   TheFileList:=TStringList.Create;
  10.   try
  11.     FindAllFiles(TheFileList, MyDirectory);
  12.     AZipper.Entries.AddFileEntries(TheFileList);
  13.     AZipper.ZipAllFiles;
  14.   finally
  15.     TheFileList.Free;
  16.     AZipper.Free;
  17.   end;
  18. end;
Title: Re: How to set a password for the archive? paszlib TZipper
Post by: Nicole on March 02, 2023, 08:08:16 pm
Are you sure, you just want to set a password?

Encryption of the content would be better.
Encryption is not an easy task and there are many ways to do it.
Perhaps you may want to key in the keyword to find out, what way fits for you.
Title: Re: How to set a password for the archive? paszlib TZipper
Post by: paweld on March 02, 2023, 08:45:37 pm
TZipper don't support password. Try Abbrevia component: https://forum.lazarus.freepascal.org/index.php/topic,15462.msg83043.html#msg83043 (https://forum.lazarus.freepascal.org/index.php/topic,15462.msg83043.html#msg83043)
TinyPortal © 2005-2018