A collision avoidance system for vehicles is provided based on wireless communications that causes detection of a co-location of two vehicles to avoid collisions between vehicles (eg, autonomous vehicles) in a privacy-preserving fashion. The collision avoidance system may deliver and receive messages from other entities on a communication channel of the system. Cryptographic challenges sent and received by vehicles may be encoded and decoded by the collision avoidance system, which may also process the cryptographic responses sent by the vehicles to the cryptographic challenges. The collision avoidance system may achieve all the above operations without revealing the location and the identity of the vehicle to any external party, thus emerging as a real-time, distributed, and privacy-preserving solution.