Generating blackmail is not illegal, using it to blackmail someone is. Generating libel is not illegal, publishing it publicly is not illegal either although you can be sued over it.
Generating worms and computer viruses is not illegal last I checked, but disseminating them is.