A mechanical and an electronic timelock