Foundations of Security: What Every Programmer Needs to Know