Town officials in Midland, Ont., have paid the ransom to reclaim data after hackers held their computer systems hostage for 48 hours, and are working to get servers back up and running again.

On September 1st, anonymous hackers took control of the town's encryption keys, rendering computer operations useless.

"At that point you confront the situation that your systems could be gone for weeks or you pay the hackers and provide the services that are absolutely needed by your citizens," explained Midland Mayor Gord McKay.

The town has not disclosed the ransom amount, but McKay said Midland made the decision to take extra precautions by isolating their systems back in April after nearby Wasaga Beach experienced a similar attack. He said the hackers were paid through the town's insurance policy, not taxpayer dollars.

"So in terms of just a large dollar being paid out, there's no taxpayer impact on that. It's just our regular annual premiums on this service."

Town officials have not yet identified the source of the attack.

Back on April 30th, the town of Wasaga Beach had their computer system compromised, shutting down its software and back-up system for seven weeks.

The town paid a $35,000 ransom for de-encryption codes to allow recovery of the data.

The total cost of the virus, including consultants, overtime, and productivity loss, saw taxpayers on the hook for just over $250,000.

"Best defence is simple, have good backups," David Skillicorn, Professor in the School of Computing at Queen's University explained on CBC's Ontario Morning. "Files have to be somewhere else that they're backed up, obviously not on your system. This is routine...everyone should be doing it."

Skillicorn said employee training is also important, so they know not to click on links in e-mails because that's how the ransomware gets into the system. He says cyberware attacks are fairly common but that unfortunately e-mails are getting more and more sophisticated, making attacks more difficult to avoid.