Would it be theoretically possible to design a 100% legal ransomware where the user voluntarily chooses to encrypt their files and pay to decrypt them? (Seriously, I always wondered if it was possible!) For example, the software would have to be voluntarily downloaded by the user, and it is clear to the user on the download website in large text that the program is ransomware. The website might say in large text on the home page, "This program locks your files and forces you to pay us with real money to get them back! Make yourself and your wallet sad, and try our ransomware today!" The terms and conditions when the program is being installed would clearly state to the user in large text that their files are about to be encrypted, and they will have to pay to get them back. The price would be set by the user before the files are encrypted. This hypothetical 100% legal program would see hypothetical users who act like Patrick from SpongeBob SquarePants.
Please note that I'm not going to do this, nor do I encourage this behaviour, but I am curious as if it is legal. I know nobody in real life would be dumb enough to voluntarily install ransomware on their computer!