A method for generating a shared secret is disclosed. In an example embodiment, a sequence of data packets is transmitted from a first node to a second node. A packet error bitmap corresponding to packets in the sequence of packets that are received correctly in a first transmission attempt is generated at the second node. Further, the packet error bitmap is transmitted from the second node to the first node. Then, the first node and the second node separately mixes the packets received correctly in the first transmission attempt to generate the shared secret.