  Security proofs of quantum key distribution (QKD) often require
post-processing schemes to simplify the data structure, and hence the security
proof. We show a generic method to improve resulting secure key rates by
partially reversing the simplifying post-processing for error correction
purposes. We apply our method to the security analysis of device-independent
QKD schemes and of detection-device-independent QKD schemes, where in both
cases one is typically required to assign binary values even to lost signals.
In the device-independent case, the loss tolerance threshold is cut down by our
method from 92.4% to 90.9%.The lowest tolerable transmittance of the
detector-device-independent scheme can be improved from 78.0% to 65.9%.
