Methodology for safety and security analysis