Several passages could fit roughly with what you are looking for:
"Blessed are you when they revile and persecute you, and say all kinds of evil against you falsely for My sake. Rejoice and be exceedingly glad, for great is your reward in heaven, for so they persecuted the prophets who were before you" (Matthew 5:11-12).
"And you will be hated by all for My name's sake. But he who endures to the end will be saved" (Matthew 10:22, see also Mark 13:13; Luke 21:17).
"The world cannot hate you, but it hates Me because I testify of it that its works are evil" (John 7:7).
"But because I tell the truth, you do not believe Me. Which of you convicts Me of sin? And if I tell the truth, why do you not believe Me? He who is of God hears God's words; therefore you do not hear, because you are not of God" (John 8:45-47).
"If the world hates you, you know that it hated Me before it hated you" (John 15:18).
"Have I therefore become your enemy because I tell you the truth?" (Galatians 4:16).
"If you are reproached for the name of Christ, blessed are you, for the Spirit of glory and of God rests upon you. On their part He is blasphemed, but on your part He is glorified" (I Peter 4:14).