fix wrong port length and aes encrypt