Old English Troian "of or pertaining to ancient Troy," from Latin Trojanus, from Troia, Troja "Troy," from the Greek name for the city, said to be from Tros, name of a king of Phrygia, the mythical founder of Troy. Trojan horse was figurative of ambush-from-within in Roman times (equus Troianus); attested in English from 1570s; the computer virus sense is attested by 1982.
As a noun from mid-14c., "inhabitant of ancient Troy;" in early modern English, the noun could mean "a determined fellow, one who fights or works hard," from the Trojans' long resistance to the Greeks in the Trojan War, but also in 17c., it was a colloquial term for "person of dissolute life, carousing companion." The trade name for a brand of prophylactic contraceptive was registered 1927 in U.S.