«كان إذا دخل الكنيف قال: بسم الله اللهم إني أعوذ بك من الخبث والخبائث»
It was the practice of the Prophet (peace and blessings be upon him):
"When he (peace and blessings be upon him) entered the toilet, he would say: In the name of Allah. O Allah, I seek refuge in You from the male and female evil jinn."
Hadith Referenceصحیح الجامع الصغیر / حرف الكاف / 4714