Feeds

Clearing swap and hibernation files properly

Two neglected open books

  • alert
  • submit to reddit

The Essential Guide to IT Transformation

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.

Build a business case: developing custom apps

More from The Register

next story
14 antivirus apps found to have security problems
Vendors just don't care, says researcher, after finding basic boo-boos in security software
Only '3% of web servers in top corps' fully fixed after Heartbleed snafu
Just slapping a patched OpenSSL on a machine ain't going to cut it, we're told
How long is too long to wait for a security fix?
Synology finally patches OpenSSL bugs in Trevor's NAS
Israel's Iron Dome missile tech stolen by Chinese hackers
Corporate raiders Comment Crew fingered for attacks
Roll out the welcome mat to hackers and crackers
Security chap pens guide to bug bounty programs that won't fail like Yahoo!'s
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
Researcher sat on critical IE bugs for THREE YEARS
VUPEN waited for Pwn2Own cash while IE's sandbox leaked
Four fake Google haxbots hit YOUR WEBSITE every day
Goog the perfect ruse to slip into SEO orfice
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
prev story

Whitepapers

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.
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.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.