Mishkat al-Masabih 358
وَعَنْ عَلِيٍّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «سَتْرُ مَا بَيْنَ أَعْيُنِ الْجِنِّ وَعَوْرَاتِ بَنِي آدَمَ إِذَا دَخَلَ أَحَدُهُمُ الْخَلَاءَ أَنْ يَقُولَ بِسْمِ اللَّهِ» . رَوَاهُ التِّرْمِذِيُّ وَقَالَ: هَذَا حَدِيثٌ غَرِيبٌ وَإِسْنَاده لَيْسَ بِقَوي
From ʿAli, who said: The Messenger of Allah ﷺ said: "The screen between the eyes of the jinn and the private parts of the children of Adam, when one of them enters the toilet, is that he says: 'Bismillah.'" Reported by at-Tirmidhi, who said: This is a gharib hadith, and its chain is not strong.