Home

Awesome

POC - Client-side ZIP and upload a list of files

This is a simple Proof of Concept of an application that generates a ZIP file from a list of files that the user has selected from his local filesystem.

Note that this is not compatible with all browsers. It has only been tested with Chrome 20.0.

Requirements

In order to run this POC, you must have node.js and npm installed.

Once the requirements are met, clone the repository and simply run:

  1. npm install
  1. npm start

After this, you should be able to access http://localhost:3000/. Select the files you want to upload in there, and once the files are uploaded, you should see a ZIP file with the contents you selected in the uploads folder.

ZIP specification

Check below an overview of the changes that need to be done in order to add support for AES. This is based on http://www.winzip.com/aes_info.htm

I. Encryption services

A. Base format reference

B. Compression method and encryption flag

C. CRC value

D. AES extra data field

Offset    Size(bytes)    Content
-------------------------------------------------------------------------------------------
0        2            Extra field header ID (0x9901)                                          -> 
2        2            Data size (currently 7, but subject to possible increase in the future) -> this value is currently 7
4        2            Integer version number specific to the zip vendor                       -> 0x0001 for AE-1, 0x0002 for AE-2
6        2            2-character vendor ID                                                   -> should always be set to the two ASCII characters "AE"
8        1            Integer mode value indicating AES encryption strength                   -> 0x01 for 128-bit encryption key, 0x02 for 192-bit encryption key, 0x03 for 256-bit encryption key
9        2            The actual compression method used to compress the file                 -> 99 is used to indicate the presence of an AES-encrypted file
-------------------------------------------------------------------------------------------

II. Zip file format

A. File format

Size (bytes)    Content
-------------------------------------------
Variable        Salt value
2               Password verification value
Variable        Encrypted file data
10              Authentication code
-------------------------------------------

B. Salt value

Key size    Salt size
---------------------
128 bits    8 bytes
192 bits    12 bytes
256 bits    16 bytes
---------------------

C. Password verification value

D. Encrypted file data

E. Authentication code