You can add an extension method to your HiddenField control--it doesn't require inheritance for it to work. But the solution is also limited, since you'll have to change the code to reference the extension method by default.
public static void SetValue(this HiddenField c, string text)
{
c.Value = HttpUtility.HtmlEncode(text);
}
public static string GetValue(this HiddenField c)
{
return HttpUtility.HtmlDecode(c.Value);
}