  Quantum key distribution (QKD) establishes secure links between remote
communication parties. As a key problem for various QKD protocols, security
analysis gives the amount of secure keys regardless of the eavesdropper's
computational power, which can be done both analytically and numerically.
Compared to analytical methods which tend to require techniques specific to
each QKD protocol, numerical ones are more general since they can be directly
applied to many QKD protocols without additional techniques. However, current
numerical methods are carried out based on some assumptions such as working in
asymptotic limit and collective attacks from eavesdroppers. In this work, we
remove these assumptions and develop a numerical finite-size security analysis
against general attacks for general QKD protocols. We also give an example of
applying the method to the recent Phase-Matching QKD protocol with a simple
protocol design. Our result shows that the finite-size key rate can surpass the
linear key-rate bound in a realistic communication time.
