The Messenger of Allah ﷺ said, "The barrier between the eyes of the jinn and the private parts of the children of Adam, when one of them enters the lavatory, is to say, 'Bismillah.'"
حدثنا محمد بن حميد الرازي حدثنا الحكم بن بشير بن سلمان حدثنا خلاد الصفار عن الحكم بن عبد الله النصري عن أبي إسحق عن أبي جحيفة
أن رسول الله ﷺ قال ستر ما بين أعين الجن وعورات بني آدم إذا دخل أحدهم الخلاء أن يقول بسم الله
[Its chain is daif] It was also narrated by Ibn Majah, Book of Purification and Its Rules, Chapter on What a Man Says When He Enters the Toilet, hadith no. 297, from Muhammad bin Humayd Razi with the same wording.It contains flaws, among them the "an"-narration of Abu Ishaq. The hadith has supporting narrations, all of them daif. As for the hadith of Muawiya bin Hayda, I did not find it as a connected narration (musnad), and the hadith of Anas was narrated by Tabarani in al-Awsat, 3/245, hadith no. 2525, and 8/32, hadith no. 7062, through two chains.