What is the difference between a shibboleth and a dog whistle? [closed]

Shibboleth

This word comes from the Old Testament. Soldiers from the tribe of Ephraim were trying to cross over the Jordan river, but another tribe, the Gileadites, controlled the river. So to identify the enemy soldiers, the Gileadites had the soldiers of Ephraim say a word they'd probably mispronounce.

They said, "All right, say 'Shibboleth.'" If he said, "Sibboleth," because he could not pronounce the word correctly, they seized him and killed him at the fords of the Jordan.

(Judges 12:6, NIV)

More recently, during WW2, Allied forces had a shibboleth, according to this Wikipedia entry:

A well-known sign/countersign used by the Allied forces on D-Day during World War II: the challenge/sign was "flash", the password "thunder", and the countersign (to challenge the person giving the first code word) "Welcome"

The thought was: even if a German soldier knew the sign and countersign, he would mispronounce these words as toonder and velkom. The inability to produce these sounds made it a shibboleth to detect the German soldier.

So a shibboleth is used as a quick verification whether a possible enemy is a friend or foe. It is a password.

Dog Whistle

The Wiktionary article cited by the OP says:

A high-pitched whistle, inaudible to humans, used to train dogs.

That which is understood only by a narrow demographic.

(politics) A political allusion or comment that only a certain audience are intended to note and recognize the significance of.

In the main usage, the whistle is inaudible to humans, but may be heard by dogs. In the political usage, an utterance may be heard by anyone, but only a subset can understand it.

A dog whistle is a covert message that everyone hears, but only a few understand.

Again, going back to WW2, there were messages that were broadcast on the radio that were only to be understood by the French Resistance.

Molasses tomorrow will bring forth cognac.

(Source)

This utterance was heard (by all) on the radio, but had a special meaning to the Resistance.

Conclusion

The shibboleth is used as a password to determine if someone is within a given group. It is a spoken word, given individually.

The dog whistle is a covert message, which is broadcast to a large, undifferentiated group, but only comprehended by a small demographic.

I will quote @FumbleFingers comment verbatim:

Usually, a shibboleth is used by people outside a group, to identify those who are in the group (sometimes the "in-group" don't even realise something is a shibboleth; if they did, they might avoid it so as not to give themselves away). But a dog whistle is used by people in the group to communicate with others in the group (it's mostly people outside the group who won't recognise it).