Design of Secure and Safe Cyber-Physical Systems