Praise be to Allah.
There is nothing wrong with taking the profits that the Islamic bank gives to its customers who invest their money in Islamically acceptable mudaarabah or in permissible shares.
With regard to the interest paid by the riba-based bank, it is haraam riba and it is not permissible to take it. It is not permissible to deposit money in a riba-based bank except in the case of necessity, in order to protect the money when there is no Islamic bank. In that case it should be limited to depositing the money in a current account with no interest, so as to do the lesser of two evils.
We have previously explained the prohibition on dealing in investment certificates of groups A, B and C, and we quoted a statement by the Islamic Fiqh Council concerning this matter, in the answer to question number 98152.
In order for investment or mudaarabah to be valid, the following conditions must be met:
1.The bank must invest the money in permissible ways, such as establishing beneficial projects, building housing and so on. It is not permissible to invest the money in building riba-based banks, cinemas or giving loans with interest to the needy. Based on that, it is essential to know the nature of the investments made by the bank.
2.There should be no guarantee on the capital. The bank should not stipulate that it is obliged to return the capital if the bank incurs a loss. If the bank stipulates that it will guarantee the capital, then this is in fact a loan contract, and any interest that is paid on it is pure riba.
3.The profit should be specified and agreed upon from the outset, but it should be specified as a percentage of the profit and not from the capital. So one of them may get, for example, one third or half or 20% of the profits and the rest goes to the other party. The contract is not valid if the profit is not known and is not specified. The fuqaha’ have stated that mudaarabah becomes invalid if the percentage of profit is not known.
It says in Mataalib Ooli al-Nuha (3/517): If he says: Take this as mudaarabah and you will have a portion of the profit or a share of the profit or something of the profit, this is not valid because it is unknown, and mudaarabah is not valid unless it is for a known amount. End quote.
What you have to do is withdraw the money from the riba-based bank, and repent to Allaah. Whatever interest you have received, it is not permissible for you to make use of it; rather you should get rid of it by spending it on the poor and needy or in the public interest.
May Allaah increase us and you in understanding and knowledge.
And Allaah knows best.