Automatically Lock Your Mac When You Walk Away
superbcrew.com
superbcrew.com
I am not entirely sure why you would need a dongle over a phone. Perhaps the the creator can chime in here and explain to us why we would chose a hardware device over what we already have in our pocket?
Edit: Sorry, it appears Knock can't actually lock your Mac. Airlock promises that functionality though - so that might be of interest to you.