As such internet and information technology have influenced the human life significantly thus the current technology cannot solely assure the security of shared information. Hence, to fulfil such requirements mass amount of research have been undertaken by various researchers among which one of the mechanisms is the use of dynamic key rather than static one. In this regard, we have proposed a method of key generation to provide the dynamic keys. The scheme not only can change the key but also provide the error control mechanism. At the end of this paper, a comparison with the existing techniques has also been made to prove the efficiency of the proposed scheme.