Section 21. Whoever violates any provision of this chapter or any rule or regulation made thereunder by the commissioner shall be punished by a fine of not more than five hundred dollars or by imprisonment for not more than six months, or both.