Does one who teaches knowledge, which the learner then uses in disobedience—such as teaching programming that is used in hacking—bear a sin? And is their conscience cleared by saying: "I absolve myself before Allah Almighty should anyone use what they learn to harm a Muslim"?
Sciences are divided into beneficial sciences, such as medicine and agriculture, which are permissible to teach and may even be obligatory; harmful sciences, such as magic and music, which are forbidden to learn and teach; and sciences that can be used for either good or harm, such as weapons manufacturing and martial arts. The latter should not be taught to anyone suspected of using them for unlawful purposes. An exception to this is spying on criminals and those who fight Islam, in order to preserve religion, honor, wealth, life, and intellect.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/27656