Skip to content

Commit 5e43670

Browse files
committed
add note about directories never being encrypted
1 parent 0c2cf03 commit 5e43670

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

testdata/readme.password

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,66 @@ $ du -h dir/bar
8080
0 dir/bar
8181
```
8282

83+
Directories seem to be not encrypted, so they can always be created, as can
84+
be seen in the field `file security status` when using `zipinfo` on a file and
85+
searching for a directory entry:
86+
87+
```
88+
Archive: zip_password.zip
89+
There is no zipfile comment.
90+
91+
End-of-central-directory record:
92+
-------------------------------
93+
94+
Zip archive file size: 482 (00000000000001E2h)
95+
Actual end-cent-dir record offset: 460 (00000000000001CCh)
96+
Expected end-cent-dir record offset: 460 (00000000000001CCh)
97+
(based on the length of the central directory and its expected offset)
98+
99+
This zipfile constitutes the sole disk of a single-part archive; its
100+
central directory contains 3 entries.
101+
The central directory is 231 (00000000000000E7h) bytes long,
102+
and its (expected) offset in bytes from the beginning of the zipfile
103+
is 229 (00000000000000E5h).
104+
105+
106+
Central directory entry #1:
107+
---------------------------
108+
109+
dir/
110+
111+
offset of local header from start of archive: 0
112+
(0000000000000000h) bytes
113+
file system or operating system of origin: Unix
114+
version of encoding software: 3.0
115+
minimum file system compatibility required: MS-DOS, OS/2 or NT FAT
116+
minimum software version required to extract: 1.0
117+
compression method: none (stored)
118+
file security status: not encrypted
119+
extended local header: no
120+
file last modified on (DOS date/time): 2026 Jan 15 21:15:18
121+
file last modified on (UT extra field modtime): 2026 Jan 15 21:15:18 local
122+
file last modified on (UT extra field modtime): 2026 Jan 15 20:15:18 UTC
123+
32-bit CRC value (hex): 00000000
124+
compressed size: 0 bytes
125+
uncompressed size: 0 bytes
126+
length of filename: 4 characters
127+
length of extra field: 24 bytes
128+
length of file comment: 0 characters
129+
disk number on which file begins: disk 1
130+
apparent file type: binary
131+
Unix file attributes (040755 octal): drwxr-xr-x
132+
MS-DOS file attributes (10 hex): dir
133+
134+
The central-directory extra field contains:
135+
- A subfield with ID 0x5455 (universal time) and 5 data bytes.
136+
The local extra field has UTC/GMT modification/access times.
137+
- A subfield with ID 0x7875 (Unix UID/GID (any size)) and 11 data bytes:
138+
01 04 e8 03 00 00 04 e8 03 00 00.
139+
140+
There is no file comment.
141+
```
142+
83143
Other encryption methods are stronger. Depending on the encryption method the
84144
encryption bit flag might or might not be set. For example: for AE-x it will
85145
be set (APPENDIX E), while for other encryption methods it might not. The flag

0 commit comments

Comments
 (0)