Toward a Public and Secure Generative AI: A Comparative Analysis of Open and Closed LLMs