In chapter 22 of the novel, Mistress Hibbins comes up to Hester and Pearl in public and speaks to Hester. It is at a public gathering to elect a new governor. Mistress Hibbins is the sister of Governor Bellingham. It is well known in the community that she is a witch.
She tells Hester to look at Dimmesdale standing up there. She says that Hester's sin is out in the open and everyone can look at it via the scarlet letter that she wears openly. There are others, she says, like Dimmesdale, who try to hide their sin from everyone, but the devil knows his own. She points out that she knows about the sin that Dimmesdale is hiding in his heart. She implies that he is a hypocrite. She predicts:
Let me tell thee in thine ear! When the Black Man sees one of his own servants, signed and sealed, so shy of owning to the bond as is the Reverend Mr. Dimmesdale, he hath a way of ordering matters so that the mark shall be disclosed in open daylight to the eyes of all the world! What is it that the minister seeks to hide, with his hand always over his heart? Ha, Hester Prynne!”
Eventually, Dimmesdale IS exposed, but not in the way you would expect! As the Bible says that only God knows a man's heart, Hawthorne is implying that Satan also knows a man's heart when that man is one of his own. In the Bible, Jesus says in John 10:17 that:
My sheep listen to my voice; I know them, and they follow me
Hawthorne is criticizing the hypocrisy of the Puritans because the same thing is true with unrepentent sinners. Satan knows who they are.
Read the novel here on eNotes and see the analysis.