Feeds

Clearing swap and hibernation files properly

Two neglected open books

  • alert
  • submit to reddit

The Power of One eBook: Top reasons to choose HP BladeSystem

The reason why I recommend using a swap file with the same initial and maximum size is simple: by default, Windows will allow the file to grow as needed, and this means that data traces will be scattered all over your disk. As the file shrinks, some data will no longer be allocated to pagefile.sys, but it will still be there on your disk. Keeping the swap file a fixed size keeps its data allocated, making it easier to clean. It's also good from a performance point of view, as disk defragmenting lasts longer when you haven't got fragments of pagefile.sys interspersed with other fragments all over the place.

So, what size should you choose? If you are short of RAM, try 1.5 to 2.0 times the amount of RAM you have. But if you've got 1GB or more of RAM, you'll rarely need more than a 1GB swap file on a home system.

Paying for convenience

Alternatively, you can use BCWipe, for which you must pay, which will eliminate the unused portion of the swap file, but not the current data in it. However, it can encrypt the swap file, if you like, so that its data can't be read. Read the help files carefully, and follow the recommendations. I will outline them briefly, but you need to get this right. First, choose a specific size for your swap file as described previously. Next, initialise the BCWipe CryptoSwap utility. Be sure to choose the option "Initialise swap file with random data when Windows starts". Now reboot. Next, do a disk wipe including file slack, disk free space, and the swap file. This will remove any leftover swap-file data traces, leaving only encrypted data in the file.

This utility encrypts and decrypts on the fly, so there is obviously going to be some performance overhead. For that reason, not everyone is going to like this method, but it is far more convenient than the manual method outlined above. You do it once, and from then all you need to wipe are file slack and free space, and of course, individual files as appropriate.

Good news for Tuxers

On a Linux system, the swap file is a disk partition and it can be wiped easily with a free tool that I created called LinuxWipeTools. This is a collection of simple Bash scripts that will allow you to wipe your disk in three modes: the swap partition alone, free space only, or an entire disk. The one you want is called WipeSwap.sh. Launch it from a root shell, and it will automatically detect your swap device, wipe it securely, and re-create it for you. You can run it conveniently in the background while you are using your computer, and there is no need to reboot. You can easily modify it and set it as a cron job, and have a freshly-wiped swap partition every day, if you like, without the slightest bother.

The Power of One eBook: Top reasons to choose HP BladeSystem

More from The Register

next story
BMW's ConnectedDrive falls over, bosses blame upgrade snafu
Traffic flows up 20% as motorway middle lanes miraculously unclog
LibreSSL RNG bug fix: What's all the forking fuss about, ask devs
Blow to bit-spitter 'tis but a flesh wound, claim team
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Putin: Crack Tor for me and I'll make you a MILLIONAIRE
Russian Interior Ministry offers big pile o' roubles for busting pro-privacy browser
Manic malware Mayhem spreads through Linux, FreeBSD web servers
And how Google could cripple infection rate in a second
Don't look, Snowden: Security biz chases Tails with zero-day flaws alert
Exodus vows not to sell secrets of whistleblower's favorite OS
Roll out the welcome mat to hackers and crackers
Security chap pens guide to bug bounty programs that won't fail like Yahoo!'s
Researcher sat on critical IE bugs for THREE YEARS
VUPEN waited for Pwn2Own cash while IE's sandbox leaked
prev story

Whitepapers

Top three mobile application threats
Prevent sensitive data leakage over insecure channels or stolen mobile devices.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Application security programs and practises
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
The Essential Guide to IT Transformation
ServiceNow discusses three IT transformations that can help CIO's automate IT services to transform IT and the enterprise.