Key Management in Ad Hoc Networks