The answer depends on what kind of aircraft you're talking about, and how much control the crew has over the pressurization systems.
For example, in theory you could very well reduce or completely shut off the air to the cabin on a 777. This could also be done by a single crew member alone. The pilots have full control of this system should say the one of the engines produce bad air to that cabin and would needed to be switched off.
As for the oxygen masks- these are for emergency descent use and have a generator that runs out after about 15 minutes. The crew bottles last a bit longer I think, but these will also have a limit, and doing any attempt to break through the bullet-proof cockpit door in those conditions I'd imagine would be very difficult, since I'm not sure you're still picking up the amount of oxygen you normally would.
For a similar situation (though not a deliberate attempt) you can read up on Helios Airways Flight 522.
For an idea of how the pilot masks look, see this video.
Source: SmartCockpit