On-chip microprocessor security for defense against malicious hardware attacks