I had a near miss yesterday as I tried a strategy of a fellow surfer: I buried my mechanical car key in the sand, put my bag on top of it, and went surfing. A few dogs on the beach must have shifted the position of the bag and I could not immediately find it; a shopkeeper lent me a rake and I was able to thoroughly sieve the sand and to find the key 10 cm away.
I have seen surfers with key boxes on door handles, such as these, and I fear that it simply says "here's the car, here's the key, I'm away for a bit."
Another option is to take it with me in the wetsuit (which I seldom use) or in the leash; most wetsuits and leashes have a key pouch. I could put the key in a waterproof bag first to avoid corrosion. I could also use such a bag with a belt and without a wetsuit, as mentioned here, although a friend and I have lost a car key in the ocean with a similar strategy.
Yet another one is the "fake-a-rock" that I found here: a fake rock with the car key inside.
What seems safest so far is what I saw from a surfer who placed a combination key box in an inaccessible part of the car, such as the wheel's drive shaft or the lower control arm after parking with the driving wheel completely turned one way. He said it's hard to break the lock hook and remove the box without the combination.
This similar thread mentions some strategies of securing keys while swimming and with a bike. My questions seems different in that it mentions a car and uses specific gear, such as leashes, which could provide a different solution. It could also apply to windsurfing and kitesurfing.
What other strategies do people use to secure the car key when they go surfing?