Have you checked out your router's manual for instructions?
There are various versions of the WRT54G, Although screen layouts may be different, the fundamentals are the same.
The network key you refer to would be called WPA or WEP, dependent on what your version of that router supports.
Also check out numerous postings in this forum. Even if they cover other makes and models, the steps for creating a WPA (preferable) or WEP passphrases/network keys/passwords are all very similar indeed.