The devil can appear as an angel of light. Such a communication can seem to be divine. Satan may have appeared to Sherem as an angel of light. Yet the prophet, Joseph Smith, gives us a secret by which we may know whether an angel is of the Lord or a messenger of Satan:
'When a messenger comes saying he has a message from God, offer him your hand and request him to shake hands with you.
If he be an angel he will do so, and you will feel his hand.
If he be the spirit of a just man made perfect he will come in his glory; for that is the only way he can appear—
Ask him to shake hands with you, but he will not move, because it is contrary to the order of heaven for a just man to deceive; but he will still deliver his message.
If it be the devil as an angel of light, when you ask him to shake hands he will offer you his hand, and you will not feel anything; you may therefore detect him.
These are three grand keys whereby you may know whether any administration is from God.' (DC 129:4-9)