The Key of Night is an item, which if put in an empty chest, it will turn that chest into a Corrupt or Crimson Mimic, depending on what biome the world has.
Unlike Mimics spawned using the Mimic Statue, the created Mimic will drop items from its loot table. While this makes farming Mimics more efficient, it also is very dangerous, as the player will begin the fight within contact range of the Mimic.
If storing the key, it must be put with any other item in the chest. If the other item is removed, the chest will turn to a Mimic when closed. The easiest way to do this is by putting a dirt block in the chest.