QKD protocol is a technique that allow two parties to share common secret key for cryptographic purpose and defined as being secure, by definition. But I am still wondering how can we measure that QKD is secure? In terms of what? and how can it be clearly proved? Is it possible by code it in any programming language like Java? well I am still looking for a good research topic under this area.
The security of QKD is based on the quantum mechanics related theorem, including uncertainty relations and no-cloning theorem. If there is a third person wants to eavesdrop the information, the action would change the quantum state which could be detected by the legal users.
The security of QKD protocols has been proven, for example in publication "Simple Proof of Security of the BB84 Quantum Key Distribution Protocol" PRL 85,441(2000).
Modern security proofs of QKD are based on information theory. Specifically, it measures the amount of entropy present between the communicating parties, i.e. if the entropy between Alice and Bob is less than the entropy between Alice and Eve, then the protocol can be deemed secure. Now, in order to get a visible statistic, there are equations that compute the key rate based on entropy of the parties.
A good survey paper is this one by Scarani et al.
To answer your second question, yes, it's possible to simulate the theoretical bounds in different languages. However, in my experience, it's often convex optimizations.