Dry red chilies turn white in moisture due to the migration of salts, particularly calcium salts, to the surface as the chili dries. When exposed to moisture, these salts dissolve and recrystallize on the surface, creating a whitish appearance.
The white substance you see on dry red chilies exposed to moisture isn't mold, but rather a concentration of naturally occurring salts. During the drying process, moisture evaporates from the chili, drawing dissolved minerals and salts from the interior to the surface. Calcium salts are particularly prevalent. When the dried chili is exposed to humidity or direct contact with water, these salts dissolve again. As the water evaporates, the dissolved salts recrystallize on the surface, forming a white, powdery or crystalline coating. This phenomenon is similar to efflorescence seen on brick walls. The color change is purely aesthetic and doesn't necessarily indicate spoilage, although excessive moisture can eventually lead to mold growth. The intensity of the white coating depends on the chili's mineral content, the drying method, and the level of humidity it's exposed to.
To prevent chilies from turning white, store them in an airtight container in a cool, dry place. Adding a desiccant packet (like silica gel) can further reduce moisture and prolong their shelf life.