A hacker who worked for former Syrian President Bashar Assad was sentenced to three and a half years in prison for his central role in a scheme targeting nearly 50 government agencies, Western media outlets, businesses and nongovernmental organizations.