Praise be to Allah.Praise be to Allaah.
Praise be to Allaah Who has honoured you by enabling you to repent, We ask Allaah to guide us all to the Straight Path and to make us steadfast in following it until death.
You should note that it is not permissible for the Muslims to cheat anyone and take his money unlawfully, even if he is a kaafir.
If the Muslim commits any sin, whether stealing or anything else, then repents before the matter is referred to the judge, then he is spared the punishment in that case, and it is not permissible to punish him, because Allaah says concerning banditry (interpretation of the meaning):
“The recompense of those who wage war against Allaah and His Messenger and do mischief in the land is only that they shall be killed or crucified or their hands and their feet be cut off from opposite sides, or be exiled from the land. That is their disgrace in this world, and a great torment is theirs in the Hereafter.
Except for those who (having fled away and then) came back (as Muslims) with repentance before they fall into your power; in that case, know that Allaah is Oft-Forgiving, Most Merciful”
And the Prophet (peace and blessings of Allaah be upon him) said: “The one who repents from sin is like one who never sinned.” And the one who did not sin cannot be punished.
Al-Ikhtiyaaraat al-Fiqhiyyah, p. 510-526; al-Mughni, 12/484
It was narrated from ‘Abd-Allaah ibn ‘Umar (may Allaah be pleased with them both) that the Messenger of Allaah (peace and blessings of Allaah be upon him) said, after al-Aslami had been stoned, “Avoid these immoral actions that Allaah has forbidden. Whoever does any of them, let him conceal that which Allaah has concealed, and let him repent to Allaah, for whoever tells us what he has done, we will carry out the ruling mentioned in the Book of Allaah on him.” (Narrated by al-Haakim in al-Mustadrak ‘ala’l-Saheehayn, 4/425; al-Bayhaqi, 8/330. This hadeeth was classed as saheeh by al-Haakim, Ibn al-Sakan and Ibn al-Mulaqqin).
See al-Talkhees al-Habeer, 4/57; Khalaasat al-Badr al-Muneer, by Ibn al-Mulaqqin, 2/303.
Based on this, you do not have to go to the authorities and tell them about your stealing, rather it is sufficient for you to repent sincerely. But you have to return the money to its owners, because your repentance is not valid otherwise. You do not have to tell them that this is money that you stole from them, especially if you are afraid that they will put you in prison. What matters is returning the money etc to its owners. So you could put it in an envelope, or give it to someone who will give it to them, etc.
You must also return the government’s money, and the money of other people. If you do not know exactly how much the money was, then estimate what you think is most likely, i.e., pay until you are sure that you have done what you must do.
If you do not know who the owners of the money are, then you can give it in charity on their behalf.