6 Answers
6

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.

Source:

"Little Known and Obscure "Factoids" Regarding Origins of Customs in the Rabbinic Period"

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.

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 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.