I'm sure your password wasn't hacked then, you probably opened file affected with someone's keylogger and he was able to see what you wrote on your keyboard. So, it's your fault. Just don't download or open files from anonymous sources and invest in good antivirus.