Three essays on the economics of cybersecurity