It is wajib to pay khums from a wealth which is mixed with some illegitimate wealth.
By "illegitimate" we mean anything that has been acquired by the means not permitted in the shari`ah, for example, usury, gambling or liquor business.
By "mixed" we mean that the owner is unable to distinguish the amount or the items which have come to his possession by lawful and legitimate means from those which he has acquired by unlawful means.
In such a situation, there are the following possibilities:
• a person who cannot distinguish the amount, the item and the owner of the wealth acquired by unlawful means from the legitimate wealth. In such a case, the only way to make his existing properties lawful is to pay khums from the entire wealth.
• a person who knows the amount or the item possessed by unlawful means but does not the owner or owners -- then he must give that amount or item to the needy as charity (sadaqah) on behalf of the unknown owner. However, before giving that amount or item as sadaqah, it is precautionarily wajib to ask the permission of the mujtahid.
• If the person knows the rightful owner but does not know the amount of the unlawfully acquired wealth, then he must come to a compromise with the owner.
• If the person knows the amount and also the owner, then it is wajib for him to return the unlawfully obtained property to its rightful owner.