Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Polyglot (computing)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer program or file valid in multiple programming languages or file formats}} {{Use dmy dates|date=April 2023}} In [[computing]], a '''polyglot''' is a [[computer program]] or [[script (computer programming)|script]] (or other file) written in a valid form of multiple [[programming language]]s or [[File format|file formats]].<ref name="ACMNOV13">{{cite book |author1=Jonas Magazinius |author2=Billy K. Rios |author3=Andrei Sabelfeld |title=Proceedings of the 2013 ACM SIGSAC conference on Computer & communications security - CCS '13 |chapter=Polyglots |date=2013-11-04 |pages=753–764 |doi=10.1145/2508859.2516685 |isbn=9781450324779 |s2cid=16516484 |chapter-url=https://dl.acm.org/doi/10.1145/2508859.2516685 |access-date=5 September 2022 |archive-date=5 September 2022 |archive-url=https://web.archive.org/web/20220905003825/https://dl.acm.org/doi/10.1145/2508859.2516685 |url-status=live }}</ref> The name was coined by analogy to [[multilingualism]]. A '''polyglot file''' is composed by combining syntax from two or more different formats.<ref name="BeyondTheHype">{{cite journal |arxiv=2012.09214|last1=Bridges |first1=Robert A. |last2=Oesch |first2=Sean |last3=Verma |first3=Miki E. |last4=Iannacone |first4=Michael D. |last5=Huffer |first5=Kelly M. T. |last6=Jewell |first6=Brian |last7=Nichols |first7=Jeff A. |last8=Weber |first8=Brian |last9=Beaver |first9=Justin M. |last10=Smith |first10=Jared M. |last11=Scofield |first11=Daniel |last12=Miles |first12=Craig |last13=Plummer |first13=Thomas |last14=Daniell |first14=Mark |last15=Tall |first15=Anne M. |title=Beyond the Hype: An Evaluation of Commercially Available Machine-Learning-Based Malware Detectors |journal=Digital Threats: Research and Practice |year=2023 |volume=4 |issue=2 |pages=1–22 |doi=10.1145/3567432 |s2cid=247218744 }}</ref> When the file formats are to be [[Compiler|compiled]] or [[Interpreter (computing)|interpreted]] as [[source code]], the file can be said to be a '''polyglot program''', though file formats and source code syntax are both fundamentally streams of bytes, and exploiting this commonality is key to the development of polyglots.<ref name="TDPF">{{cite arXiv |eprint=2203.07561|last1=Koch |first1=Luke |last2=Oesch |first2=Sean |last3=Adkisson |first3=Mary |last4=Erwin |first4=Sam |last5=Weber |first5=Brian |last6=Chaulagain |first6=Amul |title=Toward the Detection of Polyglot Files |year=2022 |class=cs.CR }}</ref> Polyglot files have practical applications in [[Computer_compatibility#Software|compatibility]],<ref>{{cite web |title=Benefits of polyglot XHTML5 |url=http://www.xmlplease.com/xhtml/xhtml5polyglot/ |access-date=4 September 2022 |archive-date=12 October 2011 |archive-url=https://web.archive.org/web/20111012190748/http://xmlplease.com/xhtml/xhtml5polyglot/ |url-status=dead }}</ref> but can also present a [[Computer security|security]] risk when used to bypass [[Data validation|validation]] or to exploit a [[Vulnerability (computing)|vulnerability]]. ==History== {{See also|Steganography#History|label 1=History of steganography}} Polyglot programs have been crafted as challenges and curios in [[hacker culture]] since at least the early 1990s. A notable early example, named simply <code>polyglot</code> was published on the [[Usenet]] group rec.puzzles in 1991, supporting eight languages, though this was inspired by even earlier programs.<ref>{{cite web |title=Polyglot: A program in eight languages |url=https://ideology.com.au/polyglot/ |access-date=6 September 2022 |archive-date=6 September 2022 |archive-url=https://web.archive.org/web/20220906233052/https://ideology.com.au/polyglot/ |url-status=live }}</ref> In 2000, a polyglot program was named a winner in the [[International Obfuscated C Code Contest]].<ref>{{cite web |title=15th International Obfuscated C Code Contest (2000) |url=https://www.ioccc.org/years.html#2000_tomx |access-date=6 September 2022 |archive-date=6 September 2022 |archive-url=https://web.archive.org/web/20220906233051/https://www.ioccc.org/years.html#2000_tomx |url-status=live }}</ref> In the 21st century, polyglot programs and files gained attention as a [[covert channel]] mechanism for propagation of [[malware]].<ref name="TDPF"/> <ref name="APF">{{cite arXiv |eprint=2407.01529|last1=Koch |first1=Luke |last2=Oesch |first2=Sean |last3=Chaulagain |first3=Amul |last4=Dixon |first4=Jared |last5=Dixon |first5=Matthew |last6=Huettal |first6=Mike | last7=Sadovnik | first7=Amir| last8=Watson | first8=Cory| last9=Weber| first9=Brian | last10=Hartman| first10=Jacob| last11=Patulski| first11=Richard |title=On the Abuse and Detection of Polyglot Files |year=2024 |class=cs.CR }}</ref> Polyglot files have practical applications in [[Computer_compatibility#Software|compatibility]].<ref>{{cite web |title=Benefits of polyglot XHTML5 |url=http://www.xmlplease.com/xhtml/xhtml5polyglot/ |access-date=4 September 2022 |archive-date=12 October 2011 |archive-url=https://web.archive.org/web/20111012190748/http://xmlplease.com/xhtml/xhtml5polyglot/ |url-status=dead }}</ref> ==Construction== A polyglot is composed by combining syntax from two or more different formats, leveraging various syntactic constructs that are either common between the formats, or constructs that are language specific but carrying different meaning in each language. A file is a valid polyglot if it can be successfully interpreted by multiple interpreting programs. For example, a PDF-Zip polyglot might be opened as both a valid PDF document and decompressed as a valid [[ZIP (file format)|zip]] archive. To maintain validity across interpreting programs, one must ensure that constructs specific to one interpreter are not interpreted by another, and vice versa. This is often accomplished by hiding language-specific constructs in segments interpreted as comments or plain text of the other format.<ref name="ACMNOV13"/> ==Examples== ===C, PHP, and Bash=== Two commonly used techniques for constructing a polyglot program are to make use of languages that use different [[Character (computing)|characters]] for [[comment (computer programming)|comments]], and to redefine various tokens as others in different languages. These are demonstrated in this [[public domain]] polyglot written in [[ANSI C]], [[PHP]] and [[Bash (Unix shell)|bash]]: {{columns-start|num=3}} '''Highlighted for Bash''' <syntaxhighlight lang="bash"> #define a /* #<?php echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ; // 2> /dev/null; x=a; $x=5; // 2> /dev/null \ ; if (($x)) // 2> /dev/null; then return 0; // 2> /dev/null; fi #define e ?> #define b */ #include <stdio.h> #define main() int main(void) #define printf printf( #define true ) #define function function main() { printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/; return 0; } #define c /* main #*/ </syntaxhighlight> {{column}} '''Highlighted for PHP''' <syntaxhighlight lang="PHP"> #define a /* #<?php echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ; // 2> /dev/null; x=a; $x=5; // 2> /dev/null \ ; if (($x)) // 2> /dev/null; then return 0; // 2> /dev/null; fi #define e ?> #define b */ #include <stdio.h> #define main() int main(void) #define printf printf( #define true ) #define function function main() { printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/; return 0; } #define c /* main #*/ </syntaxhighlight> {{column}} '''Highlighted for C''' <syntaxhighlight lang="c"> #define a /* #<?php echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ; // 2> /dev/null; x=a; $x=5; // 2> /dev/null \ ; if (($x)) // 2> /dev/null; then return 0; // 2> /dev/null; fi #define e ?> #define b */ #include <stdio.h> #define main() int main(void) #define printf printf( #define true ) #define function function main() { printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/; return 0; } #define c /* main #*/ </syntaxhighlight> {{columns-end}} Note the following: *A hash sign marks a [[preprocessor]] statement in C, but is a comment in both bash and PHP. *"//" is a comment in both PHP and C and the [[root directory]] in bash. *Shell [[Redirection (computing)|redirection]] is used to eliminate undesirable outputs. *Even on commented out lines, the "<code><?php</code>" and "<code>?></code>" PHP indicators still have effect. *The statement "<code>function main()</code>" is valid in both PHP and bash; C #defines are used to convert it into "<code>int main(void)</code>" at compile time. *Comment indicators can be combined to perform various operations. *"<code>if (($x))</code>" is a valid statement in both bash and PHP. *<code>[[printf (Unix)|printf]]</code> is a bash [[shell builtin]] which is identical to the [[printf format string|C printf]] except for its omission of brackets (which the [[C preprocessor]] adds if this is compiled with a [[C compiler]]). *The final three lines are only used by bash, to call the <code>main</code> function. In PHP the <code>main</code> function is defined but not called and in C there is no need to explicitly call the <code>main</code> function. ===SNOBOL4, Win32Forth, PureBasicv4.x, and REBOL=== The following is written simultaneously in [[SNOBOL]]4, [[Forth (programming language)|Win32Forth]], [[PureBasic]]v4.x, and [[REBOL]]: {{columns-start|num=4}} '''Highlighted for SNOBOL''' <syntaxhighlight lang="snobol"> *BUFFER : A.A ; .( Hello, world !) @ To Including? Macro SkipThis; OUTPUT = Char(10) "Hello, World !" ;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3 EndMacro: OpenConsole() : PrintN("Hello, world !") Repeat : Until Inkey() : Macro SomeDummyMacroHere REBOL [ Title: "'Hello, World !' in 4 languages" CopyLeft: "Developed in 2010 by Society" ] Print "Hello, world !" EndMacro: func [][] set-modes system/ports/input [binary: true] Input set-modes system/ports/input [binary: false] NOP:: EndMacro ; Wishing to refine it with new language ? Go on ! </syntaxhighlight> {{column}} '''Highlighted for Forth''' <syntaxhighlight lang="forth"> *BUFFER : A.A ; .( Hello, world !) @ To Including? Macro SkipThis; OUTPUT = Char(10) "Hello, World !" ;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3 EndMacro: OpenConsole() : PrintN("Hello, world !") Repeat : Until Inkey() : Macro SomeDummyMacroHere REBOL [ Title: "'Hello, World !' in 4 languages" CopyLeft: "Developed in 2010 by Society" ] Print "Hello, world !" EndMacro: func [][] set-modes system/ports/input [binary: true] Input set-modes system/ports/input [binary: false] NOP:: EndMacro ; Wishing to refine it with new language ? Go on ! </syntaxhighlight> {{column}} '''Highlighted for BASIC''' <syntaxhighlight lang="basic"> *BUFFER : A.A ; .( Hello, world !) @ To Including? Macro SkipThis; OUTPUT = Char(10) "Hello, World !" ;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3 EndMacro: OpenConsole() : PrintN("Hello, world !") Repeat : Until Inkey() : Macro SomeDummyMacroHere REBOL [ Title: "'Hello, World !' in 4 languages" CopyLeft: "Developed in 2010 by Society" ] Print "Hello, world !" EndMacro: func [][] set-modes system/ports/input [binary: true] Input set-modes system/ports/input [binary: false] NOP:: EndMacro ; Wishing to refine it with new language ? Go on ! </syntaxhighlight> {{column}} '''Highlighted for REBOL''' <syntaxhighlight lang="rebol"> *BUFFER : A.A ; .( Hello, world !) @ To Including? Macro SkipThis; OUTPUT = Char(10) "Hello, World !" ;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3 EndMacro: OpenConsole() : PrintN("Hello, world !") Repeat : Until Inkey() : Macro SomeDummyMacroHere REBOL [ Title: "'Hello, World !' in 4 languages" CopyLeft: "Developed in 2010 by Society" ] Print "Hello, world !" EndMacro: func [][] set-modes system/ports/input [binary: true] Input set-modes system/ports/input [binary: false] NOP:: EndMacro ; Wishing to refine it with new language ? Go on ! </syntaxhighlight> {{columns-end}} ===DOS batch file and Perl=== The following file runs as a [[DOS]] batch file, then re-runs itself in [[Perl]]: {{columns-start}} '''Highlighted for DOS batch''' <syntaxhighlight lang="dosbatch"> @rem = ' --PERL-- @echo off perl "%~dpnx0" %* goto endofperl @rem '; #!perl print "Hello, world!\n"; __END__ :endofperl </syntaxhighlight> {{column}} '''Highlighted for Perl''' <syntaxhighlight lang="perl"> @rem = ' --PERL-- @echo off perl "%~dpnx0" %* goto endofperl @rem '; #!perl print "Hello, world!\n"; __END__ :endofperl </syntaxhighlight> {{columns-end}} This allows creating Perl scripts that can be run on DOS systems with minimal effort. Note that there is no requirement for a file to perform exactly the same function in the different interpreters. ==Types== {{Expand section|date=September 2022}} Polyglot types include:<ref name="TDPF" /> * ''stacks'', where multiple files are concatenated with each other * ''parasites'' where a secondary file format is hidden within comment fields in a primary file format * ''zippers'' where two files are mutually arranged within each others' comments * ''cavities'', where a secondary file format is hidden within null-padded areas of the primary file. ==Benefits== {{Expand section|date=September 2022}} ===Polyglot markup=== '''Polyglot markup''' has been proposed as a useful combination of the benefits of [[HTML5]] and [[XHTML]].<ref name="w3c">{{cite web |title=Polyglot Markup: A robust profile of the HTML5 vocabulary |url=https://www.w3.org/TR/html-polyglot/ |access-date=4 September 2022 |archive-date=9 August 2022 |archive-url=https://web.archive.org/web/20220809042911/https://www.w3.org/TR/html-polyglot/ |url-status=live }}</ref> Such documents can be parsed as either HTML (which is <span style="white-space:nowrap">[[SGML]]-compatible</span>) or [[XML]], and will produce the same [[Document Object Model|DOM]] structure either way. For example, in order for an [[HTML5]] document to meet these criteria, the two requirements are that it must have an HTML5 [[Document Type Declaration|doctype]], and be written in well-formed XHTML. The same document can then be served as either HTML or XHTML, depending on browser support and MIME type. As expressed by the ''html-polyglot recommendation'',<ref name="w3c" /> to write a polyglot HTML5 document, the following key points should be observed: # Processing instructions and the XML declaration are both forbidden in polyglot markup # Specifying a document’s character encoding # The DOCTYPE # Namespaces # Element syntax (i.e. End tags are not optional. Use self-closing tags for void elements.) # Element content # Text (i.e. pre and textarea should not start with newline character) # Attributes (i.e. Values must be quoted) # Named entity references (i.e. Only amp, lt, gt, apos, quot) # Comments (i.e. Use <!-- syntax -->) # Scripting and styling polyglot markup The most basic possible polyglot markup document would therefore look like this:<ref name="w3c" /> <syntaxhighlight lang="html"> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <head> <title>The title element must not be empty.</title> </head> <body> </body> </html> </syntaxhighlight> In a polyglot markup document non-void elements (such as <code>script</code>, <code>p</code>, <code>div</code>) cannot be self-closing even if they are empty, as this is not valid HTML.<ref>[http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html#empty-elements Polyglot Markup: HTML-Compatible XHTML Documents: 6.4 Void Elements] {{Webarchive|url=https://web.archive.org/web/20121002041508/http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html#empty-elements |date=2 October 2012 }}. W3C Editor's Draft 9 July 2012.</ref> For example, to add an empty textarea to a page, one cannot use <code><nowiki><textarea/></nowiki></code>, but has to use <code><nowiki><textarea></textarea></nowiki></code> instead. ===Composing formats=== The [[DICOM]] medical imaging format was designed to allow polyglotting with [[TIFF]] files, allowing efficient storage of the same image data in a file that can be interpreted by either DICOM or TIFF viewers.<ref>{{cite web |title=DICOM-TIFF dual personality files |url=https://learn.canceridc.dev/dicom/dicom-tiff-dual-personality-files |access-date=5 September 2022 |archive-date=5 September 2022 |archive-url=https://web.archive.org/web/20220905193806/https://learn.canceridc.dev/dicom/dicom-tiff-dual-personality-files |url-status=live }}</ref> ===Compatibility=== The [[History_of_Python#Version_2|Python 2]] and [[History_of_Python#Version_3|Python 3]] programming languages were not designed to be compatible with each other, but there is sufficient commonality of syntax that a polyglot Python program can be written than runs in both versions.<ref>{{cite web |last1=Schofield |first1=Ed |title=Cheat Sheet: Writing Python 2-3 compatible code |url=https://python-future.org/compatible_idioms.html |access-date=6 September 2022 |archive-date=6 September 2022 |archive-url=https://web.archive.org/web/20220906225518/https://python-future.org/compatible_idioms.html |url-status=live }}</ref> ==Security implications== A polyglot of two formats may [[Steganography|steganographically]] compose a malicious payload within an ostensibly benign and widely accepted wrapper format, such as a JPEG file that allows arbitrary data in its comment field. A vulnerable JPEG renderer could then be coerced into executing the payload, handing control to the attacker. The mismatch between what the interpreting program expects, and what the file actually contains, is the root cause of the vulnerability.<ref name="ACMNOV13" /> [[SQL Injection]] is a trivial form of polyglot, where a server naively expects user-controlled input to conform to a certain constraint, but the user supplies syntax which is interpreted as SQL code. Note that in a security context, there is no requirement for a polyglot file to be strictly valid in multiple formats; it is sufficient for the file to trigger unintended behaviour when being interpreted by its primary interpreter. Highly flexible or extensible file formats have greater scope for polyglotting, and therefore more tightly constrained interpretation offers some mitigation against attacks using polyglot techniques. For example, the PDF file format requires that the [[Magic number (programming)|magic number]] <code>%PDF</code> appears at byte offset zero, but many PDF interpreters waive this constraint and accept the file as valid PDF as long as the string appears within the first 1024 bytes. This creates a window of opportunity for polyglot PDF files to smuggle non-PDF content in the header of the file.<ref name="TDPF" /> The PDF format has been described as "diverse and vague", and due to significantly varying behaviour between different PDF parsing engines, it is possible to create a PDF-PDF polyglot that renders as two entirely different documents in two different PDF readers.<ref>{{cite web |last1=Wolf |first1=Julia |title=OMG WTF PDF |url=https://fahrplan.events.ccc.de/congress/2010/Fahrplan/events/4221.en.html |website=27th Chaos Communication Congress |date=9 February 2011 |access-date=6 September 2022 |archive-date=9 October 2022 |archive-url=https://web.archive.org/web/20221009230207/https://fahrplan.events.ccc.de/congress/2010/Fahrplan/events/4221.en.html |url-status=live }}</ref> Detecting malware concealed within polyglot files requires more sophisticated analysis than relying on file-type identification utilities such as [[file (command)|file]]. In 2019, an evaluation of commercial anti-malware software determined that several such packages were unable to detect any of the polyglot malware under test.<ref name="TDPF" /><ref name="BeyondTheHype" /> In 2019, the DICOM medical imaging file format was found to be vulnerable to malware injection using a [[Portable Executable|PE]]-DICOM polyglot technique.<ref>{{cite journal |title=DICOM Images Have Been Hacked! Now What? |journal=American Journal of Roentgenology |date=April 2020 |volume=214 |issue=4 |doi=10.2214/AJR.19.21958 |url=https://www.ajronline.org/doi/10.2214/AJR.19.21958 |access-date=5 September 2022 |last1=Desjardins |first1=Benoit |last2=Mirsky |first2=Yisroel |last3=Ortiz |first3=Markel Picado |last4=Glozman |first4=Zeev |last5=Tarbox |first5=Lawrence |last6=Horn |first6=Robert |last7=Horii |first7=Steven C. |pages=727–735 |pmid=31770023 |s2cid=208318324 |archive-date=5 September 2022 |archive-url=https://web.archive.org/web/20220905193804/https://www.ajronline.org/doi/10.2214/AJR.19.21958 |url-status=live |url-access=subscription }}</ref> The polyglot nature of the attack, combined with regulatory considerations, led to disinfection complications: because "the malware is essentially fused to legitimate imaging files", "incident response teams and A/V software cannot delete the malware file as it contains protected patient health information".<ref>{{cite web |title=Ubiquitous Bug Allows HIPAA-Protected Malware to Hide Behind Medical Images |date=17 April 2019 |url=https://threatpost.com/hipaa-protected-malware-medical-images/143890/ |access-date=5 September 2022 |archive-date=5 September 2022 |archive-url=https://web.archive.org/web/20220905193806/https://threatpost.com/hipaa-protected-malware-medical-images/143890/ |url-status=live }}</ref> ===GIFAR attack=== A '''Graphics Interchange Format Java Archives''' ('''GIFAR''') is a polyglot file that is simultaneously in the [[GIF]] and [[JAR (file format)|JAR]] file format.<ref>{{cite web |last1=Byrd |first1=Christopher |title=How to Create a GIFAR |url=https://www.riosec.com/articles/how-to-create-a-gifar |access-date=6 March 2023 |archive-date=6 March 2023 |archive-url=https://web.archive.org/web/20230306093631/https://www.riosec.com/articles/how-to-create-a-gifar |url-status=live }}</ref> This technique can be used to exploit security vulnerabilities, for example through uploading a GIFAR to a website that allows image uploading (as it is a valid GIF file), and then causing the Java portion of the GIFAR to be executed as though it were part of the website's intended code, being delivered to the browser from the [[Same-origin policy|same origin]].<ref>{{cite web |last1=Eckel |first1=Benjamin |title=The GIFAR Image Vulnerability |url=http://hackaday.com/2008/08/04/the-gifar-image-vulnerability |website=Hackaday |date=5 August 2008 |access-date=6 March 2023 |archive-date=6 March 2023 |archive-url=https://web.archive.org/web/20230306091403/https://hackaday.com/2008/08/04/the-gifar-image-vulnerability/ |url-status=live }}</ref> Java was patched in JRE 6 Update 11, with a CVE published in December 2008.<ref name="CVE-2008-5343">{{cite web |title=CVE-2008-5343 |url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5343 |website=cve.mitre.org |access-date=20 April 2021 |date=2008-12-04 |archive-date=20 April 2021 |archive-url=https://web.archive.org/web/20210420204722/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5343 |url-status=live }}</ref><ref>{{cite web | title=A photo that can steal your online credentials| url=http://www.infoworld.com/d/security-central/photo-can-steal-your-online-credentials-306| first=Robert| last=McMillan| date=August 1, 2008| publisher=Infoworld.com| archive-url= https://web.archive.org/web/20200918084425/https://www.infoworld.com/article/2653025/a-photo-that-can-steal-your-online-credentials.html| archive-date=2020-09-18}}</ref> GIFARs are possible because GIF images store their header in the beginning of the file, and JAR files (as with any ZIP archive-based format) store their data at the end.<ref>{{cite web |last1=Rios |first1=Billy |title=Billy (BK) Rios » SUN Fixes GIFARs |url=http://xs-sniper.com/blog/2008/12/17/sun-fixes-gifars/ |access-date=20 April 2021 |archive-url=https://web.archive.org/web/20160314083259/http://xs-sniper.com/blog/2008/12/17/sun-fixes-gifars/ |archive-date=14 March 2016 |date=2008-12-17}}</ref> == Related terminology == {{Wiktionary|polyglot}} * '''Polyglot programming''', referring to the practise of building systems using multiple programming languages, but not necessarily in the same file.<ref>{{cite thesis |last=Fjeldberg |first=Hans |date=2008 |title=Polyglot Programming - A Business Perspective |type=M.Sc |publisher=Norwegian University of Science and Technology |url=http://theuntitledblog.com/wp-content/uploads/2008/08/polyglot_programming-a_business_perspective.pdf |access-date=28 May 2015 |archive-date=4 March 2016 |archive-url=https://web.archive.org/web/20160304053328/http://theuntitledblog.com/wp-content/uploads/2008/08/polyglot_programming-a_business_perspective.pdf |url-status=live }}</ref><ref>{{Cite web|url=https://medium.com/capital-one-tech/analyzing-polyglot-microservices-f6f159a1a3e7|title=Analyzing Polyglot Microservices|last=Gupta|first=Tripta|date=2018-12-19|website=Medium|language=en|access-date=2019-08-05|archive-date=5 August 2019|archive-url=https://web.archive.org/web/20190805144402/https://medium.com/capital-one-tech/analyzing-polyglot-microservices-f6f159a1a3e7|url-status=live}}</ref> * [[Polyglot persistence]] is similar, but about [[database]]s. == See also == * [[Quine (computing)]] == References == {{Reflist}} ==External links== {{wikibooks|Polyglot markup, how to}} *[http://www.htmlvalidator.com/ CSE HTML Validator for Windows with polyglot markup support] {{Webarchive|url=https://web.archive.org/web/20220918175914/https://www.htmlvalidator.com/ |date=18 September 2022 }} *[http://www.xmlplease.com/xhtml/xhtml5polyglot/ Benefits of polyglot XHTML5] {{Webarchive|url=https://web.archive.org/web/20111012190748/http://xmlplease.com/xhtml/xhtml5polyglot/ |date=12 October 2011 }} * [https://codegolf.stackexchange.com/a/266144 A polyglot in 451 different languages] * [https://raw.github.com/mauke/poly.poly/master/poly.poly A polyglot in 16 different languages] {{Webarchive|url=https://web.archive.org/web/20130514081956/https://raw.github.com/mauke/poly.poly/master/poly.poly |date=14 May 2013 }} * [http://ideology.com.au/polyglot/ A polyglot in 8 different languages] {{Webarchive|url=https://web.archive.org/web/20030803045539/http://ideology.com.au/polyglot/ |date=3 August 2003 }} (written in [[COBOL]], [[Pascal (programming language)|Pascal]], [[Fortran]], [[C (programming language)|C]], [[PostScript]], [[Unix shell]], [[Intel x86]] [[machine language]] and [[Perl]] 5) * [http://people.ksp.sk/~misof/programy/polyglot7.html A polyglot in 7 different languages] {{Webarchive|url=https://web.archive.org/web/20120426052312/http://people.ksp.sk/~misof/programy/polyglot7.html |date=26 April 2012 }} (written in [[C (programming language)|C]], [[Pascal (programming language)|Pascal]], [[PostScript]], [[TeX]], [[Bash (Unix shell)|Bash]], [[Perl]] and [[Befunge | Befunge98]]) * [http://www.retas.de/thomas/computer/programs/useless/misc/polyglot/index.html A polyglot in 6 different languages] {{Webarchive|url=https://web.archive.org/web/20081102050008/http://www.retas.de/thomas/computer/programs/useless/misc/polyglot/index.html |date=2 November 2008 }} (written in [[Perl]], [[C (programming language)|C]], [[Unix shell]], [[Brainfuck]], [[Whitespace (programming language)|Whitespace]] and [[Befunge]]) * [http://www.nyx.net/~gthompso/poly/polyglot.htm List of generic polyglots] {{Webarchive|url=https://web.archive.org/web/20030813004538/http://www.nyx.net/~gthompso/poly/polyglot.htm |date=13 August 2003 }} * [https://www.lab6.com/1 A PDF-MP3 polyglot, being a PDF document which is also an MP3 audio version of its content] {{Webarchive|url=https://web.archive.org/web/20220630232936/https://lab6.com/1 |date=30 June 2022 }} * [https://www.alchemistowl.org/pocorgtfo/ PoC||GTFO, a security publication published as polyglot PDF documents] {{Webarchive|url=https://web.archive.org/web/20180624003851/https://www.alchemistowl.org/pocorgtfo/ |date=24 June 2018 }} {{DEFAULTSORT:Polyglot (Computing)}} [[Category:Computer programming]] [[Category:Source code]] [[Category:Steganography]] [[Category:Computer file formats]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite arXiv
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite thesis
(
edit
)
Template:Cite web
(
edit
)
Template:Column
(
edit
)
Template:Columns-end
(
edit
)
Template:Columns-start
(
edit
)
Template:Expand section
(
edit
)
Template:Reflist
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Webarchive
(
edit
)
Template:Wikibooks
(
edit
)
Template:Wiktionary
(
edit
)