From Wireless Sensor Networks to Wireless Body Area Networks: Formal Modeling and Verification on Security Using PAT