Case hardening consists of adding carbon to a low carbon steel. The extra carbon is added to the surface of the part only, thereby making the surface of the part harder, but leaving the center of the part tough and malleable. This allows for a part that has a hard surface, but is not brittle and can withstand shock well.
The process of case hardening (also called pack hardening) starts by taking the low carbon steel parts after they've been machined for proper fit and packing them in a sealed container with compounds having high carbon content. In the olden days, this high carbon compound was simply animal hides or animal bones. These days, bone charcoal is often the chemical of choice. The container is made of ceramic, steel or graphite and is sealed with fire clay after being filled. The container is then heated in a furnace till it turns red-hot (approximately 950 degrees Centigrade or 1750 degrees Fahrenheit) and held at that temperature for hours depending on how many parts are being treated at a time. The animal bones and hide slowly get converted into carbon and form carbon-rich gas (carbon monoxide mainly), which migrates upon the surfaces of the steel parts and penetrates to a few thousands of an inch deep into the parts. The container is held at this temperature depending on how much depth the user wants the carbon to penetrate through the surface. Then the container is removed from the furnace and the contents are quenched in a liquid bath, typically a lot of water with a thin layer of oil added on top to lessen the shock of quenching. The surface skin of the parts become hard as glass, but the inner areas remain softer and more malleable.
Color case hardening uses a similar process to the above, but the parts are initially cleaned of all oils and greases before being put into the container with the high-carbon compounds. The process is the same as above, except during the quenching process. If the steel in quenched unevenly, different colors (blues, yellows and oranges) are produced on the steel's surface. Some people would move the steel in a jerking motion into the quenching bath to produce color bars. Many London gun makers of the 1800s used a slightly different technique: the quenching bath would be agitated with lots of air bubbles, which produces a mottled color effect on the part. Adding a little potassium nitrate to the water in the quenching bath also adds a bit of extra brightness to the colors formed.
After case hardening, the parts are taken out, cleaned, dried and then oiled or lacquered to prevent rusting.
This technique was heavily used in the 1700s and 1800s. Most parts of a gun's action or lockwork, except for the springs, were often hardened with this technique.
In the above picture, we see a lever action rifle whose lock work is case hardened in brilliant blue, yellow and dark orange shades. With color case hardening, such as the example above, the results are extremely obvious to be seen by everyone, since the bright colors are easily visible. In ordinary case hardening, there is no such indication that the case hardening operation was done. However, it is equally effective as color case hardening.
With modern steel manufacturing processes, it is possible to control the amount of carbon in the steel uniformly, which has removed much of the original reason for case hardening. However, it is still desirable in some cases to harden the surface, while leaving the inside of the part resilient and tough. In this situation, case-hardening works better, because the modern steel manufacturing processes distribute carbon uniformly through the sample, not just at the surface. Hence, in the present day, firing pins and bolt action faces are still case-hardened, since these parts are subject to shock impact and high pressures. Replica weapons are also case-hardened, so as to highlight the metal working techniques of the period.