Fixed some security issues with the tag. Redid GenerateKey based on feedback from Lucas.