Addressing the problem of that the security gap is too large for ensuring the reliability and security simultaneously, a secrecy code is proposed based on error propagation. Firstly, in order to reduce the security gap, a multi-output Bent function with optimal propagation criterion is designed to improve BER in the low SNR region. Secondly, in order to overcome the imbalance of the Bent function, an optimal construction with balance property is designed. Simulation results show that, both the security gap and the transmission power decrease for the artificial noise scheme.