Recent

Author Topic: How to set a password for the archive? paszlib TZipper  (Read 555 times)

viterik

  • Newbie
  • Posts: 2
How to set a password for the archive? paszlib TZipper
« 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/

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;

Nicole

  • Hero Member
  • *****
  • Posts: 970
Re: How to set a password for the archive? paszlib TZipper
« Reply #1 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.

paweld

  • Hero Member
  • *****
  • Posts: 970
Re: How to set a password for the archive? paszlib TZipper
« Reply #2 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
Best regards / Pozdrawiam
paweld

 

TinyPortal © 2005-2018