Invocation for Entering the Restroom
"[بِسْمِ اللهِ] اللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنَ الْخُبُْثِ وَالْخَبَائِثِ]"
[Bismillaahi] Allaahumma 'innee 'a'oothu bika minal-khubthi walkhabaa'ith.
(Before entering) [In the Name of Allah] . (Then) O Allah , I seek protection in You from the male and female unclean spirits.
Reference: Al-Bukhari 1/45, Muslim 1/283. The addition of Bismillah at its beginning was reported by Said bin Mansur. Fathul-Bari 1/244
Invocation for Leaving the Restroom
"غُفْرَانَكَ"
Ghufraanaka
I seek Your forgiveness.
Reference: Abu Dawud, Ibn Majah and At-Tirmithi. An-Nasa'i recorded it in 'Amalul-Yawm wal-Laylah. Also see the checking of Ibn Al-Qayyim's Zadul-Ma'ad, 2/387.