An encrypted ZIP file can have two correct passwords — here's why (2024)

An encrypted ZIP file can have two correct passwords — here's why (1)

Password-protected ZIP archives are common means of compressing andsharing sets of files—from sensitive documents to malware samples to even malicious files (i.e. phishing "invoices" in emails).

But, did you know it is possible for an encrypted ZIP file to have two correct passwords, with both producing the same outcome when the ZIP is extracted?

A ZIP file with twopasswords

Arseniy Sharoglazov, a cybersecurityresearcher at Positive Technologies shared over the weekend a simple experiment where he produced a password-protected ZIP file called x.zip.

The passwordSharoglazov picked for encrypting his ZIP was a pun on the 1987 hitthat's become a popular tech meme:

Nev1r-G0nna-G2ve-Y8u-Up-N5v1r-G1nna-Let-Y4u-D1wn-N8v4r-G5nna-D0sert-You

But the researcher demonstrated that when extracting x.zipusing a completely differentpassword, he receivedno error messages.

In fact, using the different passwordresulted in successful extraction of the ZIP, with original contents intact:

pkH8a0AqNbHcdw8GrmSp

An encrypted ZIP file can have two correct passwords — here's why (2)

BleepingComputer was able to successfully reproduce the experiment using different ZIP programs. We used both p7zip (7-Zip equivalent for macOS) andanother ZIP utility calledKeka.

Like the researcher's ZIP archive, ours was created with the aforementioned longer password, and with AES-256 encryption mode enabled.

While the ZIP was encrypted with the longerpassword, using either password extracted the archive successfully.

How's this possible?

Responding toSharoglazov'sdemo, a curious reader,Rafaraised an important question, "How????"

Twitter userUnblvrseems to have figured out the mystery:

ZIP uses PBKDF2, which hashes the input if it's too big. That hash (as raw bytes) becomes the actual password. Try to hash the first password with SHA1 and decode the hexdigest to ASCII... :)

— Unblvr (@Unblvr1) August 20, 2022

When producing password-protected ZIP archives with AES-256 mode enabled, the ZIPformat uses the PBKDF2 algorithm andhashes the passwordprovided by the user, ifthepassword is too long. By too long, we mean longer than 64 bytes (characters), explains the researcher.

Instead of the user's chosen password (in this case "Nev1r-G0nna-G2ve-...")this newly calculatedhash becomes the actual password to the file.

When the user attempts to extract the file, and enters apassword that is longer than 64 bytes ("Nev1r-G0nna-G2ve-..."), the user's input willonce again be hashed by the ZIP application and compared against the correct password (which is now itself a hash). Amatch would lead to a successful file extraction.

The alternative password used in this example("pkH8a0AqNbHcdw8GrmSp") is in fact ASCII representation of the longer password's SHA-1 hash.

SHA-1 checksum of "Nev1r-G0nna-G2ve-..." =706b4838613041714e62486364773847726d5370.

This checksum when converted to ASCII produces:pkH8a0AqNbHcdw8GrmSp

Note, however, that when encrypting or decrypting a file,the hashing process only occurs if the length of the password is greater than 64 characters.

In other words,shorter passwords will not be hashed at either stageof compressing or decompressing the ZIP.

This is why when picking the long "Nev1r-G0nna-G2ve-..." string as the password at the encryption stage, the actualpassword being set by the ZIP program is effectively the (SHA1) hash of this string.

At the decryption stage, if you were to enter "Nev1r-G0nna-G2ve-...," it will be hashed and compared against the previously stored password (which is the SHA1 hash). However, entering the shorter "pkH8a0AqNbHcdw8GrmSp" password at the decryption stage will have the application directly compare this value to the stored password (which is, again the SHA1 hash).

TheHMAC collisions subsection of PBKDF2 on Wikipedia provides some more technical insight to interested readers.

"PBKDF2 has an interesting property when using HMAC as its pseudo-random function. It is possible to trivially construct any number of different password pairs with collisions within each pair,"notes the entry.

"If a supplied password is longer than the block size of the underlying HMAC hash function, the password is first pre-hashed into a digest, and that digest is instead used as the password."

But, the fact that there are nowtwo possible passwords to the same ZIP does not represent a security vulnerability,"as one still must know the original password in order to generate the hash of the password," the entry further explains.

Arriving at a perfect password

An interesting key aspect to note here is, ASCII representationsof every SHA-1 hash need not be alphanumeric.

In other words,let's assume we had chosen the following password for ourZIP file during this experiment.The password is longerthan 64 bytes:

Bl33pingC0mputer-Sh0w-M3-H0W-t0-pR0Duc3-an-eNcRyPT3D-ZIP-File-in-the-simplest-way

Its SHA-1 checksum comes out to be:bd0b8c7ab2bf5934574474fb403e3c0a7e789b61

And the ASCII representation of this checksum looks like a gibberish set of bytes—not nearly elegant as the alternative password generated by the researcher for his experiment:

An encrypted ZIP file can have two correct passwords — here's why (3)

BleepingComputer askedSharoglazov how was he able to pick a password whose SHA-1 checksum would be such that its ASCII representation yields a clean, alphanumeric string.

"That's why hashcat was used," the researcher tells BleepingComputer.

By using a slightly modified version of the open source password recovery tool, hashcat, the researcher generated variations of the "Never Gonna Give You Up..." string using alphanumeric characters until he arrived at a perfect password.

"I tested Nev0r, Nev1r, Nev2r and so on... And I found the password I need."

And, that'showSharoglazov arrived at a password that roughly reads like "Never Gonna Give You Up...," but the ASCII representation of itsSHA-1 checksum is oneneatalphanumeric string.

For most users, creating a password-protected ZIP file with a choice of their password should be sufficient and that is all they would need to know.

But should you decide to get adventurous, this experiment providesa peek into one of the many mysteries surroundingencrypted ZIPs, like having two passwords to your guarded secret.

Related Articles:

Researchers extract RSA keys from SSH server signing errors

Windows 11 adds support for 11 file archives, including 7-Zip and RAR

An encrypted ZIP file can have two correct passwords — here's why (2024)

FAQs

How secure is an encrypted zip file? ›

Passwords-encrypted zip files are considered in the industry to be relatively simple to crack. Unlike website logins, encrypted zip files are easy for cybercriminals to access because unlimited password attempts are allowed.

Can zip files have passwords? ›

Can you put a password on a zip file? Windows doesn't have an option to protect your zipped file with a password, so there's no other way but to use third-party tools. You can choose from various trusted software options, such as WinZip, WinRAR(read more about safely using WinRAR), and 7-Zip.

What is the encryption method of zip files? ›

2. Using the Encrypting File System
  1. Right-click on the zip folder you want to encrypt. ...
  2. Select "Properties" from the new menu and click "Advanced."
  3. Choose the "Encrypt Contents to Secure Data Box" option.
  4. Click "OK" to close the window and choose "Encrypt the file and its parent folder."
Jun 24, 2022

What is the vulnerability of Zip encryption? ›

Vulnerability to known-plaintext attacks

Zip encryption is susceptible to known-plaintext attacks, which can reveal the encryption key when an attacker has access to both the encrypted and unencrypted versions of the same file. This vulnerability further undermines the security of Zip-encrypted files.

How do I know if my zip file is encrypted? ›

In some cases, when you attempt to unzip files from (extract) or view files in a Zip file (. zip or . zipx) a Decrypt dialog will display requesting a password. This indicates that the files in your Zip file have been encrypted.

How safe are encrypted files? ›

Encryption Can't Prevent Accidental Data Loss

No matter how highly-encrypted your data is, it is still susceptible to being transmitted to the wrong recipient via email, or otherwise shared via incorrect attachments or unsecured encryption keys.

How to encrypt a zip folder with a password? ›

Zipped folder
  1. In Windows Explorer, highlight and right-click on the files you would like to put into a zipped file.
  2. Select Send to, then Zip folder (compressed). ...
  3. Double-click the zipped file, then select File and Add Password.
  4. Fill out the requested information, then click Apply.

Can you open a zip file if you forgot the password? ›

Tip 1: Use a Free ZIP Password Remover to Open ZIP File without Password. When you forgot or lost password to your ZIP/WinZIP file, NSIS program can help you open your protected ZIP file without password. NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers.

Is a password protected zip file Hipaa compliant? ›

The short answer: an encrypted zip file would show that you implemented a control to protect PHI. Most likely this satisfies one aspect of HIPAA. The reason that you may NOT want to use an encrypted zip file is that you don't have a lot of audit ability built into the process.

What is the best encryption for zip files? ›

256-bit AES is stronger than 128-bit AES, but both of them can provide significantly greater security than the standard Zip 2.0 method described below. An advantage of 128-bit AES is that it is slightly faster than 256-bit AES, that is, it takes less time to encrypt or decrypt a file.

How do I remove encryption from a Zip file? ›

To remove encryption from the files that have been zipped, they would need to be extracted using the correct password. WinZip uses the password in combination with the appropriate key to decrypt the zipped data and recreate exact byte-for-byte duplicates of the originals.

What is the best encryption method for securing files? ›

The Advanced Encryption Standard (AES) is the trusted standard algorithm used by the United States government, as well as other organizations. Although extremely efficient in the 128-bit form, AES also uses 192- and 256-bit keys for very demanding encryption purposes.

Are encrypted zip files secure? ›

Are password-protected ZIP files secure? Zips support two different encryption methods, the old one is not secure and the current one (called AES-256) is considered secure.

Can antivirus scan password-protected zip files? ›

The password-protected archives require a password so that they can be opened and checked for malware. This notification appears because Bitdefender (or any other security solution) is unable to unpack the contents of such items and scan them.

Can zip files contain malware? ›

Zip files are not dangerous. However, it is essential to take caution when opening files you have imported from unknown sources or the files you have downloaded from the internet. Some may contain a virus, zip bombs, Trojans, or other malware.

What is the most secure zip format? ›

256-bit AES is stronger than 128-bit AES, but both of them can provide significantly greater security than the standard Zip 2.0 method described below. An advantage of 128-bit AES is that it is slightly faster than 256-bit AES, that is, it takes less time to encrypt or decrypt a file.

Can malware be hidden in zip files? ›

Detecting viruses and other malware hidden in a zip file requires first unpacking the archived file. Antivirus solutions often don't unzip files, and therefore malicious zip files pass by undetected.

Are zip files always safe? ›

Are Zip files dangerous? Zip files are not dangerous. However, it is essential to take caution when opening files you have imported from unknown sources or the files you have downloaded from the internet. Some may contain a virus, zip bombs, Trojans, or other malware.

Top Articles
Which pooling method is better? Maxpooling vs minpooling vs average pooling
How to Use Apple Cider Vinegar to Remove Plantar Warts: Leonard Greenwald, DPM: Podiatrist
#ridwork guides | fountainpenguin
Craigslist Niles Ohio
80 For Brady Showtimes Near Marcus Point Cinema
DL1678 (DAL1678) Delta Historial y rastreo de vuelos - FlightAware
O'reilly's In Monroe Georgia
Clafi Arab
Minn Kota Paws
Milk And Mocha GIFs | GIFDB.com
123Moviescloud
Leeks — A Dirty Little Secret (Ingredient)
Meritas Health Patient Portal
Sony E 18-200mm F3.5-6.3 OSS LE Review
Mflwer
Comics Valley In Hindi
Water Days For Modesto Ca
Effingham Bookings Florence Sc
H12 Weidian
Bing Chilling Words Romanized
Ubg98.Github.io Unblocked
Dover Nh Power Outage
Heart and Vascular Clinic in Monticello - North Memorial Health
Boscov's Bus Trips
Dr Ayad Alsaadi
Www.craigslist.com Savannah Ga
Jeffers Funeral Home Obituaries Greeneville Tennessee
Morse Road Bmv Hours
Powerschool Mcvsd
Kroger Feed Login
Pioneer Library Overdrive
Ucm Black Board
P3P Orthrus With Dodge Slash
Rogers Centre is getting a $300M reno. Here's what the Blue Jays ballpark will look like | CBC News
Chs.mywork
Msnl Seeds
F9 2385
RECAP: Resilient Football rallies to claim rollercoaster 24-21 victory over Clarion - Shippensburg University Athletics
Sound Of Freedom Showtimes Near Lewisburg Cinema 8
The Wait Odotus 2021 Watch Online Free
Kb Home The Overlook At Medio Creek
Alpha Labs Male Enhancement – Complete Reviews And Guide
Satucket Lectionary
'The Night Agent' Star Luciane Buchanan's Dating Life Is a Mystery
Citymd West 146Th Urgent Care - Nyc Photos
Collision Masters Fairbanks
All Weapon Perks and Status Effects - Conan Exiles | Game...
Canada Life Insurance Comparison Ivari Vs Sun Life
Tito Jackson, member of beloved pop group the Jackson 5, dies at 70
French Linen krijtverf van Annie Sloan
Olay Holiday Gift Rebate.com
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 6315

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.