Default [Q] Double-layer security?

Not sure if this belongs here, but I don't know a better place for a general question... I just rewatched an episode of the adapted Sherlock TV series and there was a character who had a phone (which contained a lot of personal, but also international secrets). The phone needed a four-digit code to unlock, but there was a catch: if you input the right code, it unlocks like usually, but if you put in a special code (which you can say is the real one), the device is wiped. How cool is that!
Basically, my question is: can such an app exist or be developed?
Device: HTC Desire C
ROM: CyanogenMod 10 (loving it)
Kernel: N.O.P.E. Kernel v2.5 850MHz