This article addresses code-based cryptography and is designed to depict the complete outline of a code based public key cryptosystem. This report includes basic mathematics and fundamentals of coding theory which are useful for studying code-based cryptography. Here, we briefly describe the first scheme of code based public key cryptosystems given by R. J. McEliece in 1978 and its improved version given by H. Niederreiter in 1986. We discuss the hard problems of coding theory which are used in code based cryptography and some classic attacks on it like information-set decoding (ISD). Successful implementation of the ISD attack on McEliece cryptosystem for some small parameters set is executed and the code for the same is provided in the Appendix. This report elaborates a key encapsulation mechanism (KEM), namely Classic McEliece, based on algebraic coding theory to establish a symmetric key for two users.