Editor's Note: This is the third in a series of six features on the science of food, running daily from March 30 through April 6, 2009.

DAVIS, Calif.—The green dot is everything in India. More than 30 percent of Indians are strict vegetarians, and among upper-class Brahmins with money to burn that number runs as high as 55 percent. Taken together, we're talking about nearly 300 million potential chocolate-eaters, a market nearly the size of the U.S. But there's one problem: the green dot.

That dot indicates that a product was made without animal products other than milk or honey. Without that dot, companies like Pennsylvania-based chocolatier Hershey Co.,which has been tapping India as a serious growth market, can kiss their profits good-bye. That's because candies like Whoppers—Hershey's chocolate-covered malted milk balls—depend on insect-derived shellac for their sheen and to preserve their shelf life for 12 months. It's also key to keep the candies clear of moisture and oxygen to so their fats do not break down, which leads to the development of off-flavors.

Shellac, sometimes called confectioner's glaze or resinous glaze, comes from the forests of Southeast Asia, where tiny-scale insects—principally Kerria lacca—suck the sap from host trees and secrete an amber-colored, resinous pigment known as lac, which females use to cling to branches. Harvesters crush these coated branches, then wash and sieve the material to purify it. Inevitably, it is replete with dismembered insect corpses. Also traditionally known as "beetlejuice," shellac is also used in everything from hair to molded phonograph records to floor varnish. And now it is also coats pharmaceutical pills, fruits and candies—including Whoppers. Though many Indians have a hand in producing the ingredient, few would put it in their mouths.

Enter John Krochta, 65, a food scientist and chemical engineer at the University of California, Davis. One fall afternoon, he leads me back to the temperature-controlled casting room where his group is busy experimenting with various formulations of edible film and their mechanical properties. For the past 20 years, Krochta's laboratory has been at the forefront of a revolution that could not only give Whoppers a green dot but could change how foods ranging from peanuts to smoked salmon are packaged. If his edible films catch on, hard-to-recycle packaging would become a thing of the past, and whey protein—a pesky waste product of milk and cheese production—would become white gold.

In the early 1990s Krochta received funding from the dairy industry to find a use for whey. He and other researchers had experimented with edible films using sugars and casein, milk's major protein, but whey's ball-like chemical structure was tough to crack. Moreover, competing water-based edible films kept flavors in and oxygen out—but they could not keep moisture in or out of foods. That meant that dry foods like crackers and cookies could become stale when exposed to moisture in the atmosphere, whereas raisins, dates and other dried fruits become stale because they lost moisture over time. By adding heat, and enzymes that speed up chemical reactions, Krochta's lab determined how to get whey molecules to open up, link together, and make a thin film.

"Whey proteins are globular and are held together by internal disulfide bonds," Krochta explains, "If you add enough internal energy it breaks these bonds, then you form intermolecular interactions." The film he created was not only edible and transparent, but it was also a barrier to moisture and a better barrier to oxygen. In 1996 he and Tara McHugh, then a graduate student, received their first patent for this technology that rendered "water-insoluble, protein-based, edible barrier coatings and films."

Today, Ohio State University postdoctoral researcher Seung Ran Yoo has cut pieces of whey-based translucent film into a bone-shaped specimen about three inches (7.5 centimeters) long. She attaches it to the clamps on a guillotine-like Instron tensile machine. Once mounted, she pushes a button on her computer, and the Instron slowly stretches the film, continuously measuring the tension force until the film breaks. One downside to whey films is that they are not particularly strong, and she has been working to combine them with sugar-based coatings to make them robusterand more flexible without compromising their oxygen-shielding abilities. These films could be used for heat-sealed packages for sliced vegetables that would dissolve during cooking.

Krochta has published scientific papers on his film's many applications, but they have yet to be widely adopted by any food manufacturers. One of his former graduate students has found a way to keep oil from permeating potatoes during deep-frying. Other research has shown that the films can incorporate antimicrobial compounds to prevent meats from spoiling. One of Krochta's early successes was formulating a whey film that doubled the shelf life of peanuts from four to eight months. "Technology transfer is really difficult," he says, "it's difficult to get people to stop doing what they're doing and get them to look at a new concept." He notes that if manufacturers used his peanut technology, for instance, they would no longer have to seal their peanuts in hard-to-recycle multilayered vacuum packages.

Krochta points out that shellac has other downsides: First off, it is an alcohol-based coating, which puts factories and their workers at risk of fires, explosions and respiratory problems. In addition, the U.S. Environmental Protection Agency (EPA) has been clamping down on candy-makers to reduce their emissions of alcohol vapors. "I think [these regulations] benefit us," he says, "because we have a water-based coating."

Chemist Jorge Bouzas, Hershey's vice president of international research and development, says that the issue with Krochta's film is "you need to have a cost-effective and efficient way to apply it to a confectionary product." In the late 1990s Hershey supported Krochta's research by supplying him with peanuts and other raw materials. Technologies to apply the films, however, were not widely available—and Bouzas says that if there's even a tiny hole in the film, the peanuts will become soggy and go bad.

Today's push into India's chocolate market, which is projected to grow about 12 percent annually over the next five years, may be just what Krochta's shellac replacement needs to take off. "His research could be very relevant for the industry in the future," Bouzas says.

Of course, just because shellac is no longer an ingredient doesn't guarantee that Indian—or any other—chocolate will be insect-free, says forensic entomologist Richard Merritt of Michigan State University who has prepared expert opinions for court cases involving Hershey's.

"People are always ready to sue Hershey's candy bars because they ate a beetle," he says. However, he points out it's probably not Hershey's fault. Insects generally do not make it into chocolate during manufacturing. Instead, they are likely to crawl into a candy bar if it has been sitting on the store shelf for a while.