Q:

Etymology of "dong" and "dongle"

Dong as in ding-dong is clearly onomatopoetic as confirmed by etymonline.com:

ding dong 
      imitative of the sound of a bell, c.1560.

and similarly for ding:

ding (v.)
      1819, "to sound as metal when struck," possibly abstracted from ding-dong, of imitative origin. The meaning "to deal heavy blows" is c.1300, probably from Old Norse dengja "to hammer," perhaps also imitative. Meaning "dent" is 1960s. Related: Dinged; dinging.

What, then, is the origin of dong to mean penis? Etymonline.com is no help here:

dong (n.) 
      "penis," 1891, of unknown origin.

We also have a much more recent word, dongle, which has no entry at etymonline.com but wiktionary claims it is:

Apparently from dangle.

This leads me to the theory that the anatomical and onomatopoetic dongs 
are not related and that the former usage, like dongle, derives from dangle. So, my questions are:

Is that so? Does dong (penis) derive from dangle? Sounds reasonable enough but I have found no definitive sources for it.
Does dongle derive from dangle? It makes perfect descriptive sense for dong but the USB devices called dongles do not dangle but instead protrude quite rigidly, so I feel that dongle being derived from the cruder meaning of dong makes more sense.

A:

No one really knows why they're called dongles. An early dongle was a "solid and non-dangling RS232 block", and it's only really modern dongles that dangle, and only then when attached to a key-fob or lanyard. A claim they were invented by "Don Gall" was just made-up for an advert.
However, we do know the computer dongle now often refers to a USB memory stick but earlier dongles were hardware security devices, without which a software program won't run. Security dongles are still used and often connect via USB. I've used serial-cable dongles, but more recently they've been USB (because more computers have USB than serial connections). It doesn't matter who copies the software: without the physical dongle, you can't use the software.
OED
The definition in the OED is for a security dongle:

A software protection device which must be plugged into a computer to enable the protected software to be used on it.
1981   New Scientist 1 Oct. 24/3   Many programs written for the Pet computer make use of a device known as a dongle. The dongle is an extra piece of memory that is plugged into the computer, without which the program refuses to run.

They say the etymology is "Arbitrary". 
Wiktionary
The meaning has passed on from a hardware security device, to any [USB-based] hardware security device, to almost any [USB] device. Wiktionary has two definitions, the first newer and more general:

(computer hardware) Any small device which plugs into an electronic device, typically a computer, and alters its functionality. Common examples include wireless modems, software copy protect devices, and adapters. Some USB keyboards and mice include USB to PS/2 adapter dongles, enabling their use on machines with PS/2 ports. 
(computer hardware) A hardware device utilized by a specific application for purposes of copy protection.

Both of these say the device interacts with the computer ("alters its functionality" or for "copy protection"), but I think it's also used much more generally as any smallish USB-based connecting thingy.
Jargon File
The earliest Jargon File entry is in version 2.1.1 of 12 June 1990:

DONGLE (don-gl) n. 1. A security device for commercial microcomputer
  programs consisting of a serialized EPROM and some drivers in an
  RS-232 connector shell. Programs that use a dongle query the port
  at startup and programmed intervals thereafter, and terminate if it
  does not respond with the dongle's programmed validation code.
  Thus, users could make as many copies of the program as they want
  but must pay for each dongle. The idea was clever but a practical
  failure, as users disliked tyng up a serial port this way. 2. By
  extension, any physical electronic key or transferable ID required
  for a program to function. See DONGLE DISK.
DONGLE-DISK (don'g@l disk) n. See DONGLE; a DONGLE-DISK is a floppy
  disk with some coding which allows an application to identify it
  uniquely. It can therefore be used as a DONGLE. Also called a "key
  disk".

In the latest version 4.4.8 the definitions have expanded:

dongle: /dong´gl/, n.

[now obs.] A security or copy protection device for proprietary software consisting of a serialized EPROM and some drivers in a D-25 connector shell, which must be connected to an I/O port of the computer while the program is run. Programs that use a dongle query the port at startup and at programmed intervals thereafter, and terminate if it does not respond with the dongle's programmed validation code. Thus, users can make as many copies of the program as they want but must pay for each dongle. The first sighting of a dongle was in 1984, associated with a software product called PaperClip. The idea was clever, but it was initially a failure, as users disliked tying up a serial port this way. By 1993, dongles would typically pass data through the port and monitor for magic codes (and combinations of status lines) with minimal if any interference with devices further down the line — this innovation was necessary to allow daisy-chained dongles for multiple pieces of software. These devices have become rare as the industry has moved away from copy-protection schemes in general.
By extension, any physical electronic key or transferable ID required for a program to function. Common variations on this theme have used parallel or even joystick ports. See dongle-disk.
An adaptor cable mating a special edge-type connector on a PCMCIA or on-board Ethernet card to a standard 8p8c Ethernet jack. This usage seems to have surfaced in 1999 and is now dominant. Laptop owners curse these things because they're notoriously easy to lose and the vendors commonly charge extortionate prices for replacements.

[Note: in early 1992, advertising copy from Rainbow Technologies (a manufacturer of dongles) included a claim that the word derived from “Don Gall”, allegedly the inventor of the device. The company's receptionist will cheerfully tell you that the story is a myth invented for the ad copy. Nevertheless, I expect it to haunt my life as a lexicographer for at least the next ten years. :-( —ESR]

And:

dongle-disk: /don´gl disk/, n.
A special floppy disk that is required in order to perform some task. Some contain special coding that allows an application to identify it uniquely, others are special code that does something that normally-resident programs don't or can't. (For example, AT&T's “Unix PC” would only come up in root mode with a special boot disk.) Also called a key disk. See dongle.

Language Log
Language Log, the linguist blog covered dongle and agree current use is more general:

The current meaning for dongle seems to be something like "a self-contained device that plugs into a  port on a computer that is normally used for connections to a separate external device"

The comments includes this from Peter Jackson that points out early dongles were far from dangly:

I was writing for MicroComputer Printout in 1982 (under a pen-name), but I don't think I was responsible for the origiinal OED citation. Which is a shame, as I always wanted to get one of those.
At the time, the only security dongle I'd come across was the solid and non-dangling RS232 block that came with AutoCAD, packed in the box under its hardback manual. It was already called a dongle by the time I came to write my first review of the package.

A:

The etymology of Dong, from the OED:  
Coined by E. Lear 1877 in Laughable Lyrics, ‘The Dong with a luminous nose’.

A fabulous creature represented as having a luminous nose; also transf.

The OED cites this as a speculative origin for dong = penis.
(the OED lists the etymology of 'dongle' as "arbitrary"... so no help there.)  It ctes two sources of note:

1981 New Scientist 1 Oct. 24/3:   Many programs written for the Pet computer make use of a device known as a dongle. The dongle is an extra piece of memory that is plugged into the computer, without which the program refuses to run.
1982 MicroComputer Printout Jan. 19/2:   The word ‘dongle’ has been appearing in many articles with reference to security systems for computer software [refers to alleged coinage in 1980].

