Join our Newsletter — 33% off our NHI Course
Home› Guides› Zip Files and Archives for Beginners: How Archives…
Guide Email & Communications Security

Zip Files and Archives for Beginners: How Archives Work and Why Attackers Hide Malware in Them

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 11 min read
On this page

An archive is one file that packs many files together, often squeezed smaller, like a zip file.

This guide is for anyone who sends or opens zip files and wants to know what is inside them and when to be careful. You do not need any technical background. Zip files are an everyday way to share work, and also a common way to deliver harmful software.

In short

  • Compression makes files smaller by writing repeated patterns once and pointing back to them, without losing any data.
  • An archive, such as a zip, 7z, RAR or TAR file, bundles many files into one, usually compressed.
  • A password-protected archive cannot be scanned for malware by email filters, which is why attackers like them.
  • Be wary of unexpected archives, especially with a password in the message or a program inside.

What you will learn

  • Explain how compression makes a file smaller.
  • Describe the common archive types you may see.
  • Spot the warning signs of a harmful archive.
  • Check an archive safely before you open what is inside.
Squeezing a file (compression)
making data take up less space without changing what it says.
A bundle of files (archive)
one file that holds many files and folders inside it.
Opening the bundle (extracting)
taking the files back out of an archive.

What is an archive?

Think of packing clothes into a vacuum bag, then putting several bags in one suitcase. The clothes take less space, and everything travels together. When you unpack, every item comes out as it went in.

An archive works like the suitcase. It holds many files in one. Most archives also compress the files, like the vacuum bag, so they are smaller to store and quicker to send [3].

Common archive types include zip, 7z, RAR and TAR. Windows 11 version 24H2 can open all four [3]. A disk image, such as an ISO file, is a close cousin. It is a container that a computer can open like a drive [7].

Where the comparison stops working: you can see through a vacuum bag. With an archive, you often cannot tell what is inside until you open it, and a password can stop security tools from looking too.

Why does it matter?

Archives are useful, but they can hide what is inside from people and from scanners. In 2022, one email security firm looked at attacks using container files, such as disk images and RAR files. It reported a rise of nearly 175% in eight months [6].

If you get email at home

What could happen: an "invoice" zip with a password in the message holds a harmful program.

Check this: confirm with the sender, using contact details you already have, before you open it.

Next: Malicious Attachments for Beginners

If you run a small business

What could happen: staff open archives from strangers, and your email filter could not see inside them.

Check this: ask your email provider how it handles password-protected attachments.

Next: Password-Protected Attachment Evasion Guide

If you are new to IT work

What could happen: a zipped backup or export you share holds keys or passwords for your systems.

Check this: look inside archives before you share them, and keep secrets out.

Next: Non-Human Identities for Beginners

What does it look like?

Here is a made-up email with an archive attached, and what the archive holds.

Example only. All values are made up.

From: [email protected]
Subject: URGENT unpaid invoice 0000                 (1)
Attached: Invoice_0000.zip                          (2)
Password for the file: FAKE0000                     (3)

Inside Invoice_0000.zip:
  Invoice_0000.pdf.exe                              (4)
  1. Pressure to act fast is a classic warning sign.
  2. An archive you did not expect.
  3. A password sent in the same message. In a real message, this line would let the attacker's file slip past the email scanner, while still being easy for you to open.
  4. A program pretending to be a PDF. The last part of the name, ".exe", shows it would run as a program.

Why this is risky: the password stops the email filter looking inside, and the file inside is a program, not a document.

The safer way: do not open it. Check with the company through its usual contact details, and report the email.

How does it work?

  1. Find the repeats. The common zip method looks for strings of data that have already appeared. It replaces each repeat with a short pointer saying "copy this many bytes from that far back" [1].
  2. Use shorter codes. It then gives common symbols shorter codes and rare ones longer codes, a method called Huffman coding [1].
  3. Bundle the files. The archive stores each compressed file with its name and folder, all in one file.
  4. Add a password, if wanted. Many archive tools can encrypt the contents, so only someone with the password can open them [5].
  5. Unpack. The tool follows the pointers and codes backwards. This kind of compression is lossless, so the files come out exactly as they went in [1].
Diagram titled How a zip file is made and opened. Five boxes in a row joined by arrows. Box 1, Your files: documents and photos. Box 2, Compress: repeats are replaced by short pointers. Box 3, Bundle: everything goes into one archive. Box 4, Optional password: contents are encrypted. Box 5, Unpack: files come out exactly as they went in. A note underneath says a password keeps strangers out, but it also stops email scanners looking inside.
Figure 1. Compress, bundle, optionally lock, then unpack.

Why attackers hide malware in archives

Passwords blind scanners. Google's admin help for Gmail says encrypted attachments cannot be scanned for malware [4]. A public catalogue of attacker methods notes that compressed files may be encrypted and password-protected, and that archives are often sent as email attachments [5].

Containers can drop the "from the internet" label. Windows adds a hidden label, called the Mark of the Web, to files from the internet such as email attachments. Office uses it to block macros, which are small programs inside documents, in files from the internet [2]. Files inside some containers, such as ISO disk images, may not carry that label once opened [7].

Self-opening archives. Some archives are really programs that unpack themselves. They can run what is inside with fewer clicks [5].

Stolen data travels zipped too. Attackers may compress or encrypt data they have collected before taking it, so less data crosses the network [8].

A different trick, the zip bomb, is a tiny archive that grows huge when unpacked. This page focuses on what archives can hide, not on that size trick.

Diagram titled Spot the signs of a risky archive, with two panels. The left panel, Warning signs, lists: you did not expect it; the password is in the same message; the sender pushes you to act fast; a file inside ends in .exe, .js, .lnk or .iso; the name has a double ending such as .pdf.exe. The right panel, Safer habits, lists: check with the sender using details you already have; look at the file list before opening anything; do not run programs from unexpected archives; report the email; ask IT if you are unsure.
Figure 2. Warning signs and safer habits for archives in email.

A worked example

This story is made up to show the idea.

Freya Hollis sells handmade cards online. One morning an email arrives from a "courier" saying a parcel could not be delivered. It has a zip file attached and says the password is 0000.

Freya is not expecting a parcel. She also notices that the email gives the password in the same message, which her email provider's help pages had warned about.

Instead of opening the zip, she looks at the file list in her email preview. It shows one file named "Delivery_note.pdf.exe". The ".exe" ending means it is a program, not a PDF.

Freya does not open it. She logs in to the courier's website by typing the address herself. There is no failed delivery for her.

She reports the email as phishing in her email app, then deletes it. Because she also lost no money, she does not need to call her bank. If she had typed in card details, she would contact her bank. She would also report it to Report Fraud [9], or in Scotland to Police Scotland on 101.

Later that week a real supplier sends her a zip of product photos. She was expecting it, there is no password, and the file list shows only pictures. She opens it with confidence.

Myths and mistakes

What people thinkWhat is true
A password-protected zip is extra safe to open.The password keeps strangers out, but it also stops email scanners looking inside [4].
Zipping a file changes or damages it.Zip compression is lossless. Files come out exactly as they went in [1].
Opening the zip is the dangerous part.The danger is usually running a program that was inside. Look at the file list first.
Encrypting a zip makes it safe to email anywhere.It protects the contents in transit. Send the password another way, and keep secrets such as keys out of shared archives.
Archive tricks only affect big companies.Archive attachments are sent to anyone with an email address, including small sellers and home users.

What can I do this week?

  • Turn on file name extensions in your computer's file viewer so you can see endings such as ".exe".
  • Next time you get a zip, look at the file list before you open anything inside.
  • Ask your email provider or IT team how password-protected attachments are handled.
  • Before you share a zipped backup or export, check it does not hold passwords or keys.
  • Report unexpected archive attachments as phishing instead of opening them.

Checklist

  • I can explain compression and archives in one sentence each.
  • I know common archive types: zip, 7z, RAR, TAR and ISO disk images.
  • I am wary of archives I did not expect.
  • I treat a password sent in the same message as a warning sign.
  • I look at the file list before I open anything inside.
  • I never run programs from an unexpected archive.
  • I keep keys and passwords out of archives I share.
  • I report suspicious attachments.

Common questions

Is it safe to open a zip file?

Usually, if you expected it and know the sender. Opening the archive to see the file list is a lower-risk step. The bigger risk is running a program inside. Be most careful with unexpected archives, passwords in the message, and files ending in .exe, .js or .lnk.

Why do some emails include a password for the attachment?

Sometimes for genuine privacy, such as payslips. Attackers copy this because encrypted attachments cannot be scanned for malware. If the password arrives in the same message as an unexpected file, check with the sender another way.

What is the difference between zip, RAR and 7z?

They are different archive formats, each with its own way of packing and squeezing files. For a beginner the job is the same: they bundle files into one. Newer versions of Windows 11 can open all three without extra software.

What is an ISO file?

An ISO file is a disk image: one container file that a computer can open like a drive. Attackers have used ISO files because files inside some containers may not carry the label Windows adds to downloads.

Does compression make a file more secure?

No. Compression only makes files smaller. Anyone can unpack a normal zip. Only an archive with encryption and a strong password keeps outsiders from reading the contents, and the password must be shared safely.

Where next?

Ready for the detail? Read the practitioner guide: Password-Protected Attachment Evasion Guide. It goes further into why encrypted attachments blind scanners, email platform settings, and block, quarantine or warn policies.

Also useful:

Related NHI Mgmt Group resources: Non-Human Identities for Beginners, Malware for Beginners and Archive and Stage Collected Data.

Key terms

Compression
Making data take less space, for example by writing repeated patterns once.
Archive
One file that holds many files and folders, usually compressed.
Lossless
Compression where the files come back exactly as they were.
Disk image (ISO)
A single container file that a computer can open like a drive.
Mark of the Web
A hidden label Windows adds to files from the internet, which other tools use to apply extra caution.
Self-extracting archive
An archive built as a program that unpacks itself when run.
Malware
Software built to harm a device, steal data or trick its user.

Sources and further reading

  1. P. Deutsch, "DEFLATE Compressed Data Format Specification version 1.3", RFC 1951, IETF, May 1996. https://www.rfc-editor.org/rfc/rfc1951 (accessed 1 Dec 2026).
  2. Microsoft Learn, "Macros from the internet are blocked by default in Office". https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked (accessed 1 Dec 2026).
  3. Microsoft Support, "Zip and unzip files". https://support.microsoft.com/en-us/windows/zip-and-unzip-files-8d28fa72-f2f9-712f-67df-f80cf89fd4e5 (accessed 1 Dec 2026).
  4. Google Workspace Admin Help, "Advanced phishing and malware protection". https://knowledge.workspace.google.com/admin/gmail/advanced/advanced-phishing-and-malware-protection (accessed 1 Dec 2026).
  5. MITRE ATT&CK, "Obfuscated Files or Information: Compression" (T1027.015). https://attack.mitre.org/techniques/T1027/015/ (accessed 1 Dec 2026).
  6. Proofpoint, "How Threat Actors Are Adapting to a Post-Macro World", Threat Insight blog, 28 July 2022. https://www.proofpoint.com/us/blog/threat-insight/how-threat-actors-are-adapting-post-macro-world (accessed 1 Dec 2026).
  7. MITRE ATT&CK, "Subvert Trust Controls: Mark-of-the-Web Bypass" (T1553.005). https://attack.mitre.org/techniques/T1553/005/ (accessed 1 Dec 2026).
  8. MITRE ATT&CK, "Archive Collected Data" (T1560). https://attack.mitre.org/techniques/T1560/ (accessed 1 Dec 2026).
  9. Report Fraud (UK), "Report fraud and cyber crime". https://www.reportfraud.police.uk/ (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.