CAVE, Caller Authentication and Voice Encryption, is an algorithm used in CDMA (Code Division Multiple Access) technology to provide secure line of air wave telecommunication. It was engineered by Committee TR45.3 of TIA/EIA under the auspices of the NSA, according to Barlow and Gilmore.

As the name says, it is basically an algorithm used to authenticate wireless user and encrypts voice call pattern. Prior each call, the terminal must be authenticated to prevent fraud or clone, and the call it self is scrambled using voice encryption. This is where CAVE comes in.

If you’re looking a more detailed techie stuff, well, … it ain’t here :) Best ask Mr. Google that :) However, I can tell you the basic application of CAVE.

When first activated, a CDMA terminal/handset must have a 6-digits checksum installed, which can be obtained by computing a combination of terminal ESN (Electronics Serial Number) and some 10-20 digits random number, which is called A-Key (Authentication Key), using CAVE algorithm. The same key informations must also be registered in HLR (Home Location Register) database of the cellular network. Upon every usage, the base station will challenge checksum value and MDN (Mobile Directory Number, a.k.a. phone number) installed in handsets against those in the HLR. If it’s a match, then the call may proceed.

In the old days, when terminal/handset does not support RUIM card, ESN is attached in the handset, and checksum must be inputted manually in the terminal. So, changing handset was not so convenient, cause you should re-input the checksum in handset and re-register it in HLR.

In RUIM age, on the other hand, the ESN is not attached in handsets, but in the RUIM card itself, together with the A-Key and checksum. So, changing handset is simply moving the RUIM for old to new handset. No settings must be made to make it work, practical ! Of course, the handsets must support RUIM card in the first place :)

If you need one, here you can download CAVE checksum calculator, which was written in C++. You should be able to compile it using gcc.