The CRY software library generates correlated cosmic-ray particle shower distributions at one of three elevations (sea level, 2100 m, and 11300 m) for use as input to transport and detector simulation codes. Our simulation is based on precomputed input tables derived from full MCNPX simulations of primary cosmic rays on the atmosphere and benchmarked against published cosmic-ray measurements. Our simulation provides all particle production (muons, neutrons, protons, electrons, photons, and pions) with the proper flux within a user-specified area and altitude. The code generates individual showers of secondary particles sampling the energy, time of arrival, zenith angle, and multiplicity with basic correlations, and has user controls for latitude (geomagnetic cutoff) and solar cycle effects. We provide a function library, callable from C, C++, and Fortran, and interfaces to popular Monte Carlo transport codes (MCNP, MCNPX, COG, Geant4). The software library and examples can be downloaded from http://nuclear.llnl.gov/simulation.