Can Shannon's entropy be used to determine if a file is encrypted?
You are likely going to have both false positives and false negatives if you try to use Shannon entropy for this.


Many compressed files would have close to 8 bits of entropy per byte, resulting in false positives.
Any encrypted file that has some non-binary encoding (like a file containing an ASCII-armored PGP message, or just a low entropy header) could have a lower entropy, resulting in false negatives.
If Format Preserving Encryption is used , this might result in false negatives too


It may work as a heuristic, but you should not rely on the results being correct.