First, let’s see what are the difference between safety and security. In a lot of languages these two words mean the same (French, German, etc.). However, in English they have different meanings.
Suppose you have a message $M$ with a $CRC(M)$ attached:

If there is any problem/error with $M$, the kind of errors we can detect/correct are random failures. Something that just happen on the line; not intentional.
Now suppose there is a malicious user:

The Malory can now modify both the message and the CRC (because the algorithm to calculate the CRC is publicly known):

So, if we have intentional modifications, the CRC will give no protection, as the Malory can also modify it.
Therefore, we can differentiate:
<aside> 📝 Note: most languages use the same word for safety and security.
</aside>
So, when we are taking about security, which are the goals of Security? The main Security goals are:
These three goals are often referred to as the CIA triad of confidentiality, integrity, and availability.