The most common source for this would be the Second Treatise on Government by John Locke, the philosopher who inspired things like the French Revolution and the American Declaration of independence, precisely because of those ideas that you mentioned.