The official text
Old and new, side by side
Indian Penal Code, 1860
Section 170 Personating a public servant
Whoever pretends to hold any particular office as a public servant, knowing that he does not hold such office or falsely personates any other person holding such office, and in such assumed character does or attempts to do any act under colour of such office, shall be punished with imprisonment of either description for a term which may extend to two years, or with fine, or with both.
Bharatiya Nyaya Sanhita, 2023
Section 204 Personating a public servant
Whoever pretends to hold any particular office as a public servant, knowing that he does not hold such office or falsely personates any other person holding such office, and in such assumed character does or attempts to do any act under colour of such office, shall be punished with imprisonment of either description for a term which shall not be less than six months but which may extend to three years and with fine.
The texts are India Code’s. The amendment markers and footnotes of the official print are left out, so the old section reads as it stood when it was repealed; State amendments are not shown. The PDFs linked below carry the full history.