As we all know, wearing masks on Purim is a Mitzva. Is it from the Torah, or was it only originated in the times of Esther, making it Rabbinic?
Actually the Tzadokim (Sadducees) interpreted the Torah, when it says "haster astir" to mean that just like Hashem wears a double mask, we must as well. So they held everyone should wear a mask on top of another mask on Purim. (No wonder they lost adherents and disappeared long ago! Try drinking wine through two masks!)
Since the ways of the Torah are pleasant and it is virtually impossible to drink high quality wine through even one mask, we Perushim (Pharisees - Horrors!) interpreted the verse to mean that only people named Esther must wear a mask on Purim. (By the way, this is also the proof that women do not have an obligation to drink on Purim (at least not high quality wine!).)
However, in order to act in contravention to the Sadducee approach (like cholent on Shabbos) the Rabbis enacted a decree that all those not drinking beyond the medically legal limit on Purim must wear a mask until they get so claustrophobic and whoozy from breathing their own exhaled carbon dioxide that they reach Ad Dilo Yada in that fashion.
So in answer to the question, it is Rabbinic but limited to those who are not drinking the amount that any sane person should drink on Purim and it was instituted after Esther's time in the middle ages of the Second Commonwealth.
"Little Known and Obscure "Factoids" Regarding Origins of Customs in the Rabbinic Period"
By Dr. Markus Shapirus M.S.G.
Actually, it's not a Mitzva by itself, but it almost became one, as documented in this passage from Meigillat Esther (From Esther's Joy): Transcripts of Esther's Joyful Conversations in the Wake of the Shushan Salvation, by Hatach.*
This conversation was recorded when Esther and Mordechai were working out what the four Mitzvot of Purim should be. They had already come up with Reading the Megila, Eating a Meal, and Gifts for the Poor, and needed one more.
Esther: Do you remember that quotation from Devarim (31:18) that you named me after - "הַסְתֵּר אַסְתִּיר פָּנַי" / "I will surely hide My face"? Why don't we make a Mitzva to recall that by wearing masks?
Mordechai: Esther, that would indeed be a nice way to make sure everyone remembers your part in all this (as if the name of the book we're writing won't be enough), but it goes against an explicit prohibition in the Torah. Did you forget Shemot 34:17? "מַסֵּכָה, לֹא תַעֲשֶׂה" / "You shall not make a mask."
Esther: Uncle, you're taking that phrase out of context! There's more to that verse - "מַסֵּכָה, לֹא תַעֲשֶׂה-לָּךְ" / "You shall not make a mask for yourself." Clearly, the prohibition only applies to making your own mask. That gives me a great idea for a detail for my new Mitzva - everyone has to make masks and give them to each other as presents. What a fun Mitzva!
Mordechai: Okay, Esther, you got me there. I think we might need some more details, though. For one thing, I think the masks will need to be filled.
Esther: What do you mean, filled?
Mordechai: You'll see what I mean in a second, if you'll just bear with me through this exegesis. God (I can mention Him explicitly now, right?) said in Shemot 23:15 "ולא-יראו פני ריקם" / "And they shall not see My face empty." Now, clearly, this isn't talking about God's "face" (whatever that means), since He says in Shemot 33:20 "לֹא תוּכַל לִרְאֹת אֶת-פָּנָי" / "You cannot see My face." If we can't see His "face" at all, we certainly can't see it empty. So, what does the first verse come to teach us? That we can't see something else called a face when it's empty, so that must mean God's mask.
Esther: What does that mean - "God's mask"?
Mordechai: I don't know; I'm not a Kabbalist, but it doesn't matter. When we apply "וְהָלַכְתָּ, בִּדְרָכָיו" / "And walk in His ways" (Devarim 28:9), we see that we ought never present someone with an empty mask.
Esther: Okay, so people have to give each other filled masks. What should they be filled with?
Mordechai: Let's go back to the first verse again, where we refer to the mask as a "face" that should be filled. If we were talking about a flesh-and-blood king, what would he fill his face with?
Esther: Ugh! Did you really have to remind me? I got a good view of that very phenomenon - twice! So, you think people should fill the masks they give each other with food and drink?
Mordechai: Sure, why not? It'll come in handy at the meal we already said they should have.
So, although the original intention of Purim's originators was to require that Mishloach Manot be distributed in masks, specifically, that aspect of the Mitzva seems to have fallen by the wayside, leaving just the presents of food and drink. If the masks had stuck as a Mitzva, I'd probably classify it as a Rabbinic Mitzva with lots of Scriptural support.
* Meigillat Esther is out of print, thanks to the Yemini family's opposition to publishing these transcripts of unguarded moments, but I was B"H able to find a scan of the manuscript on FarsiBooks.org.
The Mitzva is similar to Cholent.
There is a verse which seems to prohibit it: "מסכה לא תעשו לכם אני יהוה אלהיכם" Therefore, the Tzedukim never made masks.
However, there is a Drasha which says that since the prohibition on making masks is placed close to the commandment to observe Pesach, one is only prohibited to make masks on Pesach.
Therefore, to show that we are not Tzedukim, we must make masks some point throughout the year.
Since there is a prohibition to make masks on Pesach, the classes on the Halachos banning masks must have begun thirty days beforehand - on Purim.
Therefore, on Purim everyone must make masks.
Moreover the Gematria of "The Masks" (130) * 3(for the amount of holes in a typical mask) is equal to the Gematria of Cholent (404) - 7 (for the amount of letters there) * 2 (the amount of times one eats cholent).
It's Rabbinic, so Rabbinic that it only actually applies to rabbis. See Talmud Boggly, Tractate Kesutin 11j:
The disciples at Ya'ara De-agma were studying the laws of Holy Books. R' Dapa opened with the law: A Holy book may not be brought into the room of necessities.
R' 'Atzra responded: but didn't Rava teach us that a Torah scholar is worthy of even greater respect than a Sefer Torah? How can a Torah scholar enter the room of necessities? Many tried to practice in accordance with R' 'Atzra, but it did not work out for them, as the necessities were indeed necessary.
R' Kasa found the solution: Just as a Holy Book may be covered once or maybe twice and brought into the room of necessities, so a Torah scholar may be covered once or twice and brought there. The disciples were already careful to keep themselves covered and thus were able to enter.
It was difficult for R' Zara: Doesn't at least one of the covers have to be one that isn't particular to him? But we are all wearing our own garments!
So they made their hats and jackets ownerless and hung them outside the room of necessities, and each one would wear a hat and jacket belonging to the other, and would enter.
Then a scribe came from Nyta, and the world saw the hats and the jackets, and the disciples saw that the hats and the jackets were all the same, and they regretted the seeing of the eye, for it looked like each one was still wearing his particular cover.
R' Bama settled them: Get up, and let us replace the hats and the jackets with masks and with costumes. They got up, they replaced, they shared, and they entered.
Purim came, and many of the people treated the whole world entire like the room of necessities. Came R' Katla, and decreed: Torah scholars should leave the whole world entire on Purim. Fearfully, they told him about R' Bama, and he added: ... unless if so that they are wearing masks and costumes. They wore, they remained, they survived, and they celebrated.
It actually originates from the time of the creation. As is well known (Mesechtas Brias HaOlam 35b) on Rosh HaShana of the year 1 Hashem made special clothing out of fig leaves for Adam and Eve. All the animals were laughing at the site of a clothed human. The question remains as to why then do we commemorate this story with dressing up on Purim? The Sefer "Bube Maisas" page 213 says that these fig leaves were worn until the day after Purim when Eve finally got around to making clothing out of Techeiles Ubutz.