First of all please do not try in any way this on your computer!
One of the best methods to keep far from your computer any malware and viruses it is to use an anti virus program.
There are a few very good, some of them free or free to test.
Some of the best include (alphabetical order) Avira, ESSET or Malwarebytes
But you have to pay a lot of attention on the updates.
We made a very simple test using an innovative solution from Malwarebytes, one of the best software we test till now and discover a lot of things. But we used the solution from January 2016 of Malwarebytes for LOCKY ransomware. We put something more: what’s happening with an end of March 2016 version of LOCKY if we use a very powerful solution made in January 2016, without any update. If we test with the January 2016 LOCKY everything work fine, our files remain on hard disk not encrypted But with the actual version of LOCKY please view the video
(If you are using Internet Explorer or Edge and cannot see the video please just download the plugin https://tools.google.com/dlpage/webmmf/ )
Well, first of all we enable the protection, after that we are opening the virus.
All seems to be fine, but as we can see the virus already connects to the website getting the last piece which transform our JPEGs in encrypted files.
At the end the anti-ransomware report to us that we have a virus it is already too late, all our files got wrong.
The fault it is not of Malwarebytes, it is or because: we used an outdated solution. Moreover this it is a beta solution so we should be very careful.
The best solution to be not infected it is to keep our attention on what files are we opening.
You should understand very well that today it is very simple to have your files and you computer hijacked by cyber attacks.
Keep in touch with your system security consultant all the time to know the threats of your network