Rod Sprague said:
if it's a piece of nasty malware it will be there no matter what and lock you completely out of safari unless you pay or know how to remove it
While that sort of malware exists for Windows (e.g. Cryptolocker), it doesn't exist for the Macintosh. There is no malware currently in existence for the Macintosh that can lock you out of Safari permanently, or which will encrypt your data and hold it for ransom unless you pay a fee.
However, there is an annoying bit of Javascript code going around that mimics Cryptolocker, and it will even run on the Macintosh, but it can't actually encrypt any of your data, permanently lock you out of Safari, or cause any permanent damage. It exists to do nothing more than scare the willies out of you (and that's *all* that it can do). See:
magmatic.com - Magmatic Awareness Alert System - Condition Remains*Green
If you encounter the above Javascript (i.e. you find that you can't get out of your browser and a scary message telling you that your data is damaged or that you have to pay a ransom), here is how to recover:
* Disable Javascript in your browser. DO NOT RESET SAFARI OR FORCE QUIT.
* Hit the Back button in Safari.
* Enable Javascript.
* Reset History and Top Sites as a precaution.
If you want to avoid encountering this problem completely:
* Make sure to disable (de-select) "Open Safe Files" in Safari Preferences.
* Set Gatekeeper in System Preferences to "Mac App Store" to prevent installation of rouge Applications