Governments, law enforcement agencies, and even private citizens use malware to circumvent encryption and to spy on users. Knowing how it works can help you protect yourself.