The present invention provides a micropackaged device comprising: a substrate for securing a device with a corrosion barrier affixed to the substrate, wherein the corrosion barrier comprises a first thin-film layer, a metal film coating the thin-film layer and a second thin-film layer to provide a sandwich layer; and optionally at least one feedthrough disposed in the substrate to permit at least one input and or at least one output line into the micropackaged device, wherein the micropackaged device is encapsulated by the corrosion barrier. Methods of producing the micropackaged device are also disclosed.