Refactored AUTH packet generation to use proper Payload() and Packet() classes and encrypt_and_hash() is now a separate method.