  Quantum Key Distribution (QKD) is one of the most important aspects of
quantum cryptography. Using laws of quantum mechanics as the basis for
security, the key distribution process is made information theoretically secure
in QKD. With the advancement and commercialization of QKD, an end-to-end QKD
simulation software is required that can include experimental imperfections.
Software of this kind will ensure that resources are invested only after prior
performance analysis, and is faithful to experimental capacities and
limitations. In this work, we introduce our QKD simulation toolkit qkdSim,
which is ultimately aimed at being developed into such a software package that
can precisely model and analyse any generic QKD protocol. We present the
design, implementation and testing of a prototype of qkdSim that can accurately
simulate our own experimental demonstration of the B92 protocol. The simulation
results match well with experiment; a representative key rate and QBER from
experiment is $51 \pm 0.5$ Kbits/sec and $4.79\% \pm 0.01\%$ respectively,
wherein the simulation yields $52.83 \pm 0.36$ Kbits/sec and $4.79\% \pm
0.01\%$ respectively.
