Skip to main content

ZIP

Supported formats

ZIP, including all common compression and encryption methods

Description

Due to the popularity of the ZIP format, this backend has been designed and implemented from scratch with performance in mind. It can unpack ZIP objects created by all popular software.

info

Available in Contextal Platform 1.0 and later.

Features

High Compatibility

All common popular compression and encryption methods are supported:

  • shrink
  • reduce
  • implode
  • deflate
  • deflate64
  • bzip2
  • lzma
  • xz
  • zstd
  • zipcrypto
  • aes128
  • aes192
  • aes256

High Performance

The backend has been designed with performance in mind - according to our tests, it outperforms other popular solutions by a large margin!

Auto-Decryption Support

The backend is capable of performing contextual auto-decryption of encrypted archives.

Symbols

Object

  • LIMITS_REACHED → limits triggered while processing the archive

Children

  • ZIP_BAD → the child object wasn't extracted due to errors
  • ZIP_UNSUP → this child object wasn't extracted due to unsupported compression method
  • ZIP_DSIZE_MISMATCH → uncompressed size mismatch detected in this child object
  • ZIP_CSIZE_MISMATCH → compressed size mismatch detected in this child object
  • ENCRYPTED → this child object is encrypted
  • DECRYPTED → this child object was successfully decrypted
  • CORRUPTED → this child object was not extracted due to data corruption
  • TOOBIG → this child object was not extracted as it exceeds the limits

Example Metadata

{
"org": "ctx",
"object_id": "3c359704e456651a73a59774a1f370833009ab3ab0fa31a11c0dbefcc36a6a02",
"object_type": "ZIP",
"object_subtype": null,
"recursion_level": 1,
"size": 1352833,
"hashes": {
"md5": "82df9c38909d6b70e1caeac6a877e42a",
"sha512": "5a5eb6b5fb9865b735a7fdcf06ad9b9aeaf9c0f073758f74834bc25fd42b485d4a6bd691206a2064adc6d89c116f8806341fb38bbf2a8e2457a72adaf2c499f2",
"sha256": "3c359704e456651a73a59774a1f370833009ab3ab0fa31a11c0dbefcc36a6a02",
"sha1": "aefb7c74385af04bf9b0a6e3997b776d0a1b82ff"
},
"ctime": 1720714857.06627,
"ok": {
"object_metadata": {
"_backend_version": "1.0.0",
"archive_comment": "",
"has_encrypted_entries": false,
"num_entries": 6,
"zip64": false
},
"children": [
{
"org": "ctx",
"object_id": "7f6daa7faec84b91a8f7a8e406715852648a4c1af08b13d421079d6d42e0a7d8",
"object_type": "HTML",
"object_subtype": null,
"recursion_level": 2,
"size": 406250,
"hashes": {
"md5": "84563d29ecb50a71f54a372b9bb19a30",
"sha512": "94b205f9ea1f40a2b68ed80a83b39aa703028a9e7778def2f5b878c9db393ce521ddfd2e307ae0c9c7bb22403ec09fed00ef7759f106b733f73ec3b3aac23217",
"sha256": "7f6daa7faec84b91a8f7a8e406715852648a4c1af08b13d421079d6d42e0a7d8",
"sha1": "e5858ac13a0a7bdb64433cf59d0529566c933c55"
},
"ctime": 1720714857.06627,
"relation_metadata": {
"compressed_size": 256916,
"compression_factor": 1.5812561304083823,
"compression_method": 8,
"crc32": 149958453,
"encrypted": false,
"file_comment": "",
"is_text": true,
"local_and_central_headers_match": true,
"msdos_file_attributes": 0,
"name": "invoice.html",
"names_mismatch": false,
"origin_os_or_fs": 3,
"timestamp": 1706101194,
"uncompressed_size": 406250,
"unix_file_attributes": 33188
},
[...]

Example Queries

object_type == "ZIP" &&
@has_child(@match_relation_meta($compression_factor > 30))
  • This query matches a ZIP file, which contains an object with a very high (> 30) compression ratio.
object_type == "ZIP" &&
@has_child(@has_symbol("CORRUPTED"))
  • This matches a ZIP, where some children was found to be corrupted.

Configuration Options

  • max_processed_size → maximum size of the input object that will be processed (default: 262144000)
  • max_children → maximum number of children objects to create (default: 100)
  • max_child_input_size → maximum size of a single input children object (default: 41943040)
  • max_child_output_size → maximum size of a single output children object (default: 41943040)