Acts 23:5, Speak evil. Actually, the passage in the Torah to which this verse makes reference is Exodus 22:28, which forbids reviling Elohim and cursing (i.e., condemning, putting a spell on or threatening) a ruler, which is what Paul does when he threatens the high priest with the judgment of Elohim, even though Paul, as an apostle commissioned by Yeshua, may have been justified in executing righteous judgment. He nevertheless set us an example of showing resect to human leaders though evil and lawless they maybe.
Exodus 22:28, Curse a ruler. The TWOT notes that in Hebrew there are six words that are all translated into the English word curse in the KJV. Each word has a different connotation, which our word curse fails to convey. In this verse, behind curse is the Hebrew word arar meaning “bind with a spell, to hem in with obstacles, render powerless, to resist.” This word is used for Elohim cursing the serpent and the earth (Gen 14, 17), Cain, and Balak hiring Balaam to curse Israel (Num 22:6ff). In the majority of times, the use of arar is used in the Scriptures falls under three broad categories: (a) the declaration of punishments (Gen 3:14, 17); (b) the utterance of threats (Jer 11:3; 17:5; Mal 1:14); (c) the proclamation curses for violation of Elohim’s laws (Deut 27:15; 28:16–19) (Ibid.).