Whoever bribes or attempts to bribe anyone expecting to hold any official position under the election or registration laws of this State, either as registrar, inspector, judge or otherwise, by giving money or the promise of money, office or the promise of office or position either under the state or federal government, to perform any service for any political party in this State or to favor any candidate for political office shall be fined not more than $1,000 and may be imprisoned not more than 6 months.