Security of networks depends on reliable key management systems which generate and distribute symmetrical/asymmetrical encryption/decryption keys between communicating parties. Traditionally, in wired networks, a central server is responsible to generate and distribute the keys securely. But because of no central server or fixed infrastructure exists in mobile ad hoc networks, there are many difficulties to carryout key management in dynamic and self organized mobile ad hoc networks. The dynamic change in topology results in the change of trust relationship among the nodes. In this paper, we have proposed a key management scheme in grouped network structure in which group leader of a group is randomly shifted, our scheme of key management doesn't require any trusted third party. The group leader is responsible to generate and distribute ids and public-private key pair to nodes. This method reduces the quantity of keys to distribute among the nodes. Using Public key cryptography (PKC) any of the two members of group can share a session key securely to communicate.