It's not illegal to pay off a ransom for your data. It should be, but it isn't.
It depends.
It is illegal if the ransom is being paid to an entity that is sanctioned or in a sanctioned country such as Russia, Iran, North Korea, etc.
It does not matter that the payer didn't know the ransom is coming from a sanctioned country, the payer is breaking the law.
Here's a source for checkng present sanctions. https://ofac.treasury.gov/
"The U.S. Department of the Treasury’s Office of Foreign Assets Control (OFAC) announced that paying ransom to cybercriminals is now illegal. In an official advisory, the agency stated that organizations that facilitate ransomware payments to hackers on behalf of ransomware victims, including financial institutions, cyber insurance firms, and companies involved in digital forensics and incident response, are violating OFAC regulations."
And a cyber crime advisory.
https://ofac.treasury.gov/medi...
It's also illegal to use a third party to facilitate payments to sanctioned entities, or to be the third party.
But it appears to be Ok to pay if you know the ransom is being done by a fellow American or, I suppose, a European. Except for this week, Norwegians.