Origin of the phrase "Open Sesame"
The phrase, "Open Sesame", is a curious one indeed. Until a few days ago I foolishly believed that it was derived from a slurring of the words "Open, says me".
But after coming to the story of Ali Baba And The Forty Thieves in my copy of The Arabian Nights, in which Ali Baba opens a magical door with the words, "Open, O Simsim", I have revised my thoughts. Was my first guess correct, or Is my second guess, that the common phrase is derived from, "Open, O Simsim" correct?
Most likely from the Hebrew word "סיסמה", which translates to "password".
The pronunciation of the word out loud is (approximately, going off information a native speaker told me) "seez-ma" or "sees-ma".
Now this provokes the question:
In the story, Ali Baba's brother became trapped in the cave and couldn't get out. He did try other grains though... If the phrase was originally something like "password" or "password for opening" (literally), why would he guess other grains?
However, it turns out that tale wasn't originally in The 1001 Nights. It was first seen in a French translation by Antoine Galland.
Galland claimed that he heard the folk tale in Aleppo, Syria. However, some scholars argue that Galland made up the story himself, since no documentation of the story in old Arabic records has ever been found. It does not appear in the oldest copy of "The Thousand and One Nights," which is an Arabic manuscript from the 14th century. In "One Thousand and One Nights," the storyteller Scheherazade tells "Ali Baba and the Forty Thieves" to her husband, the Persian king Shahryar.
TL;DR: Galland claimed it's a Syrian tale, but it's most likely he made it up. It's not in the oldest version, plus the making-it-up explains the other grains.
If he made it up, it's most likely that "סיסמה" (seesma) became "sesame".
While Galland did know Hebrew, this idea that Galland got the word from Hebrew seems unlikely. Galland wrote in the early 1700s. At some point in the development of modern Hebrew (20th century), people needed a word for "password", and somebody found an obscure word in an old Hebrew text which meant "password/signal". It doesn't seem at all likely that Galland knew this word. See this blog post.