encyclopegia.org

Compression virus

A compression virus is an example of a benevolent computer virus, invented by Fred Cohen.[1] It searches for an uninfected executable file, compresses the file and prepends itself to it.[src] The virus can be described in pseudo code program compression-virus:= {01234567; subroutine infect-executable:= {loop:file = get-random-executable-file; if first-line-of-file = 01234567 then goto loop; compress file; prepend compression-virus to file; } main-program:= {if ask-permission then infect-executable; uncompress the-rest-of-this-file into tmpfile; run tmpfile;} } The 01234567 is the virus signature, and is used to make sure (if first-line-of-file = 01234567) the file is not already infected.[src] The virus then asks for permission (ask-permission) to infect a random executable (get-random-executable-file).[src] If the permission is granted, it compresses the executable (infect-executable), prepends itself to it (prepend), uncompresses the current executable file (uncompress the-rest-of-this-file) into a temporary file (tmpfile) and runs it (run tmpfile).[src] Cruncher is an example of a compression virus, a strain of which – Cruncher.2092 – is described by McAfee as memory-resident virus that infects all but small com files, making them smaller.[3] The reason for excluding small programs is that their infected versions will be bigger than their originals.[src]

A compression virus is an example of a benevolent computer virus, invented by Fred Cohen.[1] It searches for an uninfected executable file, compresses the file and prepends itself to it.[src] The virus can be described in pseudo code program compression-virus:= {01234567; subroutine infect-executable:= {loop:file = get-random-executable-file; if first-line-of-file = 01234567 then goto loop; compress file; prepend compression-virus to file; } main-program:= {if ask-permission then infect-executable; uncompress the-rest-of-this-file into tmpfile; run tmpfile;} } The 01234567 is the virus signature, and is used to make sure (if first-line-of-file = 01234567) the file is not already infected.[src] The virus then asks for permission (ask-permission) to infect a random executable (get-random-executable-file).[src] If the permission is granted, it compresses the executable (infect-executable), prepends itself to it (prepend), uncompresses the current executable file (uncompress the-rest-of-this-file) into a temporary file (tmpfile) and runs it (run tmpfile).[src] Cruncher is an example of a compression virus, a strain of which – Cruncher.2092 – is described by McAfee as memory-resident virus that infects all but small com files, making them smaller.[3] The reason for excluding small programs is that their infected versions will be bigger than their originals.[src]

14 sentences · 14 cited inline · 3 references stored

References

  1. Fred Cohen & Associates · retrieved 2026-11-18 · rev 1135258308
    Cite this reference

    MLA "Fred Cohen & Associates." 2026-11-18. http://all.net/books/virus/index.html. Accessed 27 November 2026.

    Chicago "Fred Cohen & Associates." 2026-11-18. http://all.net/books/virus/index.html.

    APA encyclopegia.org. (2026). Fred Cohen & Associates. Retrieved November 27, 2026, from http://all.net/books/virus/index.html

  2. Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1135258308
    Cite this reference

    MLA "Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19." Mark A. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1135258308. Accessed 27 November 2026.

    Chicago "Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19." Mark A. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1135258308.

    APA Mark A. (2026). Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19. Retrieved November 27, 2026, from https://en.wikipedia.org/w/index.php?oldid=1135258308

  3. McAfee article on Cruncher.2092, read Characteristics · retrieved 2009-07-28 · rev 1135258308
    Cite this reference

    MLA "McAfee article on Cruncher.2092, read Characteristics." "McAfee article on Cruncher. 2009-07-28. https://web.archive.org/web/20100823073607/http://vil.nai.com/vil/content/v_318.htm. Accessed 27 November 2026.

    Chicago "McAfee article on Cruncher.2092, read Characteristics." "McAfee article on Cruncher. 2009-07-28. https://web.archive.org/web/20100823073607/http://vil.nai.com/vil/content/v_318.htm.

    APA "McAfee article on Cruncher. (2009). McAfee article on Cruncher.2092, read Characteristics. Retrieved November 27, 2026, from https://web.archive.org/web/20100823073607/http://vil.nai.com/vil/content/v_318.htm

Cite this article

MLA

"Compression virus." encyclopegia.org, 2023, https://encyclopegia.org/wiki/compression-virus. Accessed 27 November 2026.

Chicago

"Compression virus." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/compression-virus.

APA

encyclopegia.org. (2023). Compression virus. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/compression-virus

Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Hepatitis B virus

stub · references available

lossy compression

stub · references available

video compression

stub · references available

time–space compression

stub · references available

Compression

stub · references available

Newcastle disease virus

stub · references available

image compression

stub · references available

Stars virus

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1135258308 · 0.5 · snapshot enwiki-001135258308

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.