Clearing swap and hibernation files properly

Two neglected open books

  • alert
  • submit to reddit

Securing Web Applications Made Simple and Scalable

The old-fashioned way

Let's look at doing this manually first. On Windows, the swap file is a hidden file in the root directory called pagefile.sys. To wipe it securely you must disable swapping, delete the file manually if it remains, securely wipe your disk's free space, and then re-enable swapping. This is a very cumbersome procedure, but here's how to do it:

First, ensure that you have Windows Explorer set to show hidden and protected system files. Open Windows Explorer, go to My Computer ==> Local Disk (C:), and from the menu bar choose Tools ==> Folder Options. In the Folder Options dialogue box, choose the "View" tab, and do the following: select the radio button beside the option "Show hidden files and folders", and clear the tick-box beside the option "Hide protected operating system files (Recommended)" (There are a few other useful settings here that we will discuss in a forthcoming article). Click the Apply button and close the Folder Options dialogue box.

All right, now that you can finally see what's in your filesystem, do this:

1. Disable memory swapping temporarily. Go to Control Panel ==> System ==> Advanced ==> Performance (click "Settings") ==> Advanced ==> Virtual Memory (click "Change"). On the Virtual Memory dialogue box, choose "No paging file", and click the button labelled "Set". Now click "Apply" (and "OK" several times), and re-boot your machine.

Disable Swap

2. You are now ready to delete your swap file, if disabling virtual memory did not delete it automatically. Open Windows Explorer and navigate to the root directory, i.e., My Computer ==> Local Disk (C:). Look for pagefile.sys, and delete it if it's present. Next, empty your Recycle Bin.

3. Now, fire up your wipe utility, and wipe all the free space and file slack on your disk.

4. When that's finished, go back to Control Panel ==> System ==> Advanced ==> Performance (click "Settings") ==> Advanced ==> Virtual Memory (click "Change"). On the Virtual Memory dialogue box, choose "Custom size", ensure that the initial and maximum sizes are the same, and click the button labelled "Set". Now click "Apply" (and "OK" several times), and re-boot your machine once more. Voilà, you've got a clean swap file, at least for now.

The smart choice: opportunity from uncertainty

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
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
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Manic malware Mayhem spreads through Linux, FreeBSD web servers
And how Google could cripple infection rate in a second
How long is too long to wait for a security fix?
Synology finally patches OpenSSL bugs in Trevor's NAS
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
prev story


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.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.