Securing Generative AI: Understanding Prompt Injection and Defense