The three-party password-based key exchange protocols using Weil pairing proposed by Wen is vulnerable to impersonation attack. By introducing hard artificial intelligence problem, we show an improved protocol, which can resist against not only the impersonation attack but also all the other well-known attacks. Analysis also shows that improved protocol reduces about one third computational cost and two thirds throughput. The protocol is suitable for lightweight or mobile equipments.