Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What encryption algorithm is used by linux's 'zip' command? [closed]

Tags:

zip

encryption

I'm aware that the default encryption provided by the zip command in Linux isn't considered to be secure, but I'm curious - what algorithm does it use when encrypting with the --encrypt option?

like image 462
Mike Avatar asked Jan 14 '13 15:01

Mike


People also ask

What is the encryption algorithm used to encrypt the zip file?

To create that key 7-Zip uses derivation function based on SHA-256 hash algorithm.

How does zip command work?

The zip program puts one or more compressed files into a single zip archive, along with information about the files (name, path, date, time of last modification, protection, and check information to verify file integrity). An entire directory structure can be packed into a zip archive with a single command.

What is zip legacy encryption?

Legacy (Zip 2.0) encryption: this older encryption technique provides a measure of protection against casual users who do not have the password and are trying to determine the contents of the files.

How good is zip encryption?

Zip files can be password-protected, but the standard Zip encryption scheme is extremely weak. If your operating system has a built-in way to encrypt zip files, you probably shouldn't use it. To gain the actual benefits of encryption, you should use AES-256 encryption.


2 Answers

Since the zip command will write out PKZIP files, it would follow they're implementing the specs for that. Apparently the format allows for several distinct ciphers, the one typically considered "insecure" looks like it's homegrown.

See here for a detailed discussion of how to break it, including some insights into the original algorithm: http://math.ucr.edu/~mike/zipattacks.pdf

like image 118
Magnus Avatar answered Oct 05 '22 06:10

Magnus


Traditional encryption is based on a stream cypher by Roger Schaffely. The exact, symmetric algorithm is illustrated here http://www.academia.edu/348210/PKZIP_Algorithm

Newer versions of the linux zip utility (zip-info) seem to be going to include AES encryption aswell: http://www.info-zip.org/phpBB3/viewtopic.php?f=4&t=396&p=2453&hilit=aes#p2453

like image 38
Lemonade Avatar answered Oct 05 '22 05:10

Lemonade