Section 14. A primary, election or other officer whose duty it is to recount the ballots cast at a primary or election, who makes any statement or gives any information in regard to a ballot cast by a voter challenged at such primary or election, except as required by law, shall be punished by a fine of not more than one hundred dollars or by imprisonment for not more than six months. A primary or election officer who makes any statement or gives any information in regard to a Confidential Registration certificate, as defined in section fifty-one A of chapter fifty-one, except as required by law, shall be punished by a fine of not more than five hundred dollars or by imprisonment for not more than one year.