Today the middle finger means "FUCK YOU!", but was actually invented in Golden-Age Athens 2500 years ago, not Medieval times. It originated from Ancient Greek comedy called The Clouds by Aristophanes. In this play, the actors mocked a politician by stating that his competitor had a longer dick. They showed this by running around with their middle finger pointing out from their dick area. It was meant to be stupid. It's meaning changed over time, but always was considered insulting.
Girls actually insult themselves when they give people the middle finger, but is also very offensive to men.