Photographs by Michael Appleton for The New York Times

Before Hilberto Vargas got arrested this year for stripping cars, he says he made cannoli and sugar donuts in a bakery on the Lower East Side.

Now serving time on Rikers Island, he is back in the kitchen: Mr. Vargas bakes whole wheat bread, and occasionally helps out with a sheet cake or, on special occasions, carrot cake.

“They don’t hardly give it to us enough,” Mr. Vargas said of the carrot cake, which is little known outside the prison’s walls, but famous within them. It’s made for holidays, including Thanksgiving, Christmas and Ramadan, which began Aug. 11 this year.

When the cafeteria serves it, inmates frequently ask for seconds. It’s also not unusual for correction officers in other facilities ask for the cake, said Kay Fraser, a baker who has worked at the bakery for four years and usually has a loaf – or 100 – on hand in the freezer.

The Rikers Island bakery turns out 11,500 loaves of whole wheat bread a day to feed its 13,000 inmates. Ms. Fraser and the inmates bake roughly 2,500 loaves of carrot cake a year, in 25-loaf batches, which require 25 pounds of sugar, 25 pounds of prewhipped eggs and 25 pounds of shredded carrots, among other ingredients.

Each loaf – chock full of raisins and walnuts – serves 20 people and weighs nine and a half pounds. This considerable heft makes it easy to imagine what else might be in the bread: a file? Dynamite? Keys to a getaway car? One bakery employee held up a handful of crushed foam packaging and joked, “This is the main ingredient for the carrot cake.”

But the prisoners swear the recipe is clean; logistically, they noted, it would be difficult to smuggle items in the loaves. “They don’t let anything back to the main building,” said Mr. Vargas, as he draped his arms through the iron bars separating the bakery from the rest of Rikers Island.

He and nearly 20 other inmates arrive at the bakery just before 5 a.m. each day. Dressed in orange-and-white-stripe jumpsuits, rather than aprons, they take their positions throughout a 11,000 square-foot kitchen to bake the bread. Some load the industrial mixers, while others wheel fresh-baked loaves into giant walk-in refrigerators.

“I myself was kind of impressed with the size of the machines,” said Larry King, who is serving an eight-month sentence for drug possession.

Mr. King (not the CNN host) had no previous kitchen experience before he began working in the bakery two months ago. He earns 39 cents an hour, which he uses to buy toothpaste and soap at the jail commissary.

He considers himself a morning person, and appreciates the work because it keeps his mind and body active. Most days he works the slicer, which cuts and wraps the bread, but he prefers the molder, where he catches 20-pound trays of dough, each with four loaves, off a conveyor belt and stacks them onto racks.

“It’s good, it keeps you busy,” said Brian Sangiorgio, who was arrested in May for dealing marijuana, and who was drafted during a recent visit to help load 25 pans of carrot cake batter into an oven.

With beads of sweat collecting on her brow, Ms. Fraser kept a close eye on the batch. After 20 minutes, she pulled out a nicely browned loaf.

“The color is right, so I’m going to drop the temperature,” she said. “If it’s too hot, it will get too dark.”

The carrot cake bakes for 20 minutes at 400 degrees, so that it rises and gets a “nice dome,” Ms. Fraser said. Then she reduces the temperature to 350 degrees for another 20 minutes.

The bakery distributes its whole wheat bread to the other jails in the city and sells it for 76 cents a loaf to the Department of Juvenile Justice for its facilities. But while a few people have suggested it, the carrot cake is neither distributed nor sold. According to the city’s Department of Correction, Rikers just does not have the capacity — enough machines or space — to supply the bread to the public.

“The raisins are large raisins, they’re very sweet, and basically the flavor is very good-tasting cake,” Mr. King said. “It’s just a blessing to get it fresh.”

Rikers Island Carrot Cake

25 pounds sugar

3 gallons vegetable oil

25 pounds flour

8 ounces salt

1 pound baking powder

8 ounces baking soda

6 ounces nutmeg

6 ounces allspice

4 ounces clove powder

4 ounces ginger

8 ounces cinnamon

25 pounds carrots

25 pounds eggs

8 pounds walnuts

20 pounds raisins

8 ounces vanilla extract

1. Place in a mixing bowl – sugar, flour, cinnamon, nutmeg, ginger, clove powder, allspice, baking powder, baking sods, salt. Using a paddle mix on slow for five minutes.

2. Add raisins, carrots, walnuts, eggs, vegetable oil and vanilla extract mix on slow speed for an additional five minutes.

3. Increase speed to medium for 10 minutes.

4. Pour into loaf pans. Pans should be three-quarters full.

5. Bake at 350° for 40 minutes.

Each batch makes 25 loaves of carrot cake.