Detection and quantitative characterization of the internal cavities in proteins remain an important topic in studying protein structure and function. Here we propose a new analytical method for detecting the existence of cavities in proteins. The method is based on constructing the special enveloping triangulation enclosing the cavities. Based on this method, we develop an algorithm and a fortran package. CAVE, for computing volumes and surface areas of cavities in proteins. We first test our method and algorithm in sonic artificial systems of spheres and find that the Calculated results are consistent with exact results. Then we apply the package to Compute volumes and surface areas of cavities for some protein structures in the Protein Data Bank. We compare our calculated results with those obtained by some other methods and find that Our approach is reliable. (C) 2008 Wiley Periodicals, Inc.