The most important part of the lockbox is, of course, the locking mechanism. I thought of using a solenoid like this one, but they are too expensive for the number of boxes that I needed to make.
I tried googling for some ideas for a locking mechanism, and came across a reverse geocaching box which was invented by Mikal Hart (whom I didn't know at the time, but I later became friends with coincidentally for unrelated reasons). He used a hobby servo. I found some cheap servos on alibaba for $2.45 each.
These are the worst Chinese knockoff servos ever. Strangely they don't actually function like normal servos. They are either at 0 degrees, or 180 degrees. No in-between. That's all I needed anyway, and they were super cheap, so I'm not complaining.
I ended up going with this cool see-through pencil box by vaultz because:
A) It looks nice.
B) I like the idea of being able to see whats going on inside while trying to open it.
C) It has a spring based latch mechanism that can be moved to the inside of the box and controlled by the servo (one of my friend's ideas).This box was actually the most expensive item on the BOM clocking in at $9.99!
Here is a picture of the locking mechanism. The latch was removed and placed on the inside of the box. The servo was superglued on the inside of the box. An electrical wire was used to connect the horn of the servo to the latch to pull it open. When servo rotates back 180 degrees, the spring inside the latch pulls the latch closed.