As mentioned in the comments, the word need in this case is two different parts of speech, since need can be a noun (a need) or a verb (to need). Both of these sentences are negating a noun, which is need in one case, and protection in the other.
Negation Rules
In most cases, the negation goes before the word it is negating. For nouns, we often use the negation words no, none, neither, or zero. For example:
- I have no apples.
- I have zero clean bowls left.
- I want none of the options.
- She wore neither of my favorite shirts.
Your Example
I need no protection!
In this case, the negation is of the noun protection, so the negator no comes before it. The verb, need, is not actually the word being negated.
I have no need for protection.
In this case, the word need is being used as a noun and is the word being negated, which is why no comes before it. The verb is have.
These two sentences are both correct and have the same meaning. However, they both sound antiquated or stiffly formal - like the type of sentence someone in the 1800s might have said.
Negating Verbs
In modern English, using no before a noun is not as common as it used to be, and often sounds overly formal or old fashioned, as I mentioned above. The other negation words, such as neither, none, etc. are still commonly used before nouns, but it's different when using no, which is applied to uncountable nouns.
Instead, we negate the verb. Here are some more natural-sounding examples:
- I have no apples. → I don't have any apples.
- She likes no sweets. → She doesn't like sweets.
- I need no protection! → I don't need protection.
- The boy has no need for the love of his friends. → The boy doesn't need his friends to love him.