  Local randomisation is a preprocessing procedure in which one of the
legitimate parties of a quantum key distribution (QKD) scheme adds noise to
their version of the key and was found by Kraus et al. [Phys. Rev. Lett. 95,
080501 (2005)] to improve the security of certain QKD protocols. In this
article, the improvement yielded by local randomisation is derived for an
imperfect implementation of the BB84 QKD protocol, in which the source emits
four given but arbitrary pure states and the detector performs
arbitrarily-aligned measurements. Specifically, this is achieved by modifying
an approach to analysing the security of imperfect variants of the BB84
protocol against collective attacks, introduced in [Phys. Rev. A 88, 012331
(2013)], to include the additional preprocessing step. The previously known
improvement to the threshold channel noise, from 11\% to 12.41\%, is recovered
in the special case of an ideal BB84 implementation and becomes more pronounced
in the case of a nonideal source. Finally, the bound derived for the asymptotic
key rate, both with and without local randomisation, is shown to be tight with
the particular source characterisation used. This is demonstrated by the
explicit construction of a family of source states and optimal attacks for
which the key-rate bound is attained with equality.
