Emulation-based security measurement with applications in avionics, redaction, and industrial control