347. Whoever wrongfully confines any person for the purpose of extorting from the person confined, or from any person interested in the person confined, any property or valuable security, or of constraining the person confined, or any person interested in such person, to do anything illegal or to give any information which may facilitate the commission of an offence, shall be punished with imprisonment for a term which may extend to three years, and shall also be liable to fine.