According to Section 84 that is, the Information Technology Act (2000) claims that it is legal to be a hacker only if he or she is appointed by the government in order to safeguard the public's interests. It also comes with a set of rules for the hacker to follow and abide by. So you can legally learn hacking by any online course.