# Create password protected zipfile

**URL:** <https://forum.servoy.com/t/create-password-protected-zipfile/20317>\
**Category:** Questions\
**Created:** [September 15, 2020, 3:28pm UTC](https://forum.servoy.com/t/create-password-protected-zipfile/20317 "2020-09-15T15:28:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wouter](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@wouter](https://forum.servoy.com/u/wouter)\
**Post date:** [September 15, 2020, 3:28pm UTC](https://forum.servoy.com/t/create-password-protected-zipfile/20317/1 "2020-09-15T15:28:36Z")

</div>

Hi,

I am looking for a solution to create a password protected zip-file. My solution creates a file that is send as an attachment to a external email-address outside my direct control. The attached file contains sensitive information and the file needs to be protected.

I know how to create a zipfile using the svyUtils scope, but this will not put a password on the file. Anybody have a good idea/best practice to get this done? There are u number of options here where I encrypt the file before compressing it but I am looking for an elegant solution that does not burden the receiving system with too much added complexity.

Any help or tips would be appreciated.

W.

---

<div class="post-metadata">

**Author:** ![sdevlin](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sdevlin/32/4488_2.png) [@sdevlin](https://forum.servoy.com/u/sdevlin)\
**Post date:** [September 15, 2020, 4:18pm UTC](https://forum.servoy.com/t/create-password-protected-zipfile/20317/2 "2020-09-15T16:18:59Z")

</div>

Hi Wouter,

The svyUtils extension is based on what is available in the base Java Runtime (JRE\>java.uitl.zip).  
Also, standard zip encryption is weak and easily hacked.

This can be done with a 3rd-party, open-source java lib, [zip4j](https://github.com/srikanth-lingala/zip4j).  
There is an [article about it here](https://stackoverflow.com/questions/10587561/password-protected-zip-file-in-java).

Java can be executed directly in Servoy’s code editor (with a little classpath prefixing).

Also, you would have to include the binary distribution in your classpath (i.e. servoy plugins folder)

Hope this helps.  
Sean
