The name Chaves, from the Portuguese word for keys, dates from the time when citizens literally locked up the place at night.