A method is provided for locking and unlocking an electronic power tool. The method includes receiving, at a locking device, information associated with the electronic power tool, and generating, at the locking device, a lock code based on the received information. The method further includes transmitting, by the locking device, the lock code to the electronic power tool. The lock code is configured to lock the electronic power tool upon being received at the electronic power tool.