Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: When we sat with the Prophet (peace and blessings be upon him) for the tashahhud in prayer, we used to say: 'As-salamu 'alallahi qabla 'ibadihi' "Peace be upon Allah before His servants, peace be upon Jibra'il, peace be upon Mika'il, peace be upon so-and-so, peace be upon so-and-so." Then the Messenger of Allah (peace and blessings be upon him) said: "Indeed, Allah Himself is al-Salam (Peace). When one of you sits in prayer, let him say: 'At-tahiyyatu lillahi was-salawatu wat-tayyibatu, as-salamu 'alayka ayyuhan-nabiyyu wa rahmatullahi wa barakatuhu, as-salamu 'alayna wa 'ala 'ibadillahis-salihin' (All verbal, physical and financial acts of worship are for Allah. Peace be upon you, O Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon all the righteous servants of Allah.) When a person says these words, the greeting reaches every righteous servant in the heavens and the earth. 'Ashhadu an la ilaha illallahu wa ashhadu anna Muhammadan 'abduhu wa rasuluhu' (I bear witness that there is no deity worthy of worship except Allah, and I bear witness that Muhammad (peace and blessings be upon him) is His servant and His Messenger.) Then, after that, let him ask whatever supplication he wishes."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2877