Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


February 2008

Manage Your EFS Keys with Cipher

Examine and decrypt anything encrypted by anyone
RSS
Subscribe to Windows IT Pro | See More Utilities Articles Here | Reprints
Or get the Monthly Online Pass—only $5.95 a month!

Encrypting File System (EFS) lets you encrypt important files so that life is tough for the folks trying to steal sensitive data. However, like any encryption system, EFS isn’t all wine and roses: If you lose your encryption keys, not only will the bad guys be unable to read your data, you won’t be able to read it, either. Key management and recovery is therefore extremely important to any EFS user, and EFS’s command-line tool Cipher (cipher.exe) can help.

Back Up Your EFS Key
The first time that you use EFS to encrypt something, your system generates a random 256-bit number; that’s the key that EFS uses whenever you encrypt something. To back up your EFS key, simply use the Cipher /x command. Cipher will reply with a message asking if you truly want to back up your EFS key—sadly, I haven’t found a way to suppress this message. Press OK. The tool will then prompt you for the name of the file in which to store the backup. Don’t specify a file extension; Cipher insists on the .pfx extension. For example, if you picked a file named mybackup, you now have a small file called mybackup.pfx. Next, the tool will prompt you to create a password with which to protect that file.

Once you’ve got that file created, copy it from your computer’s hard disk to some offline location (e.g., a USB stick, a CD-ROM) and make a note of the password you’ve chosen. Now, in the event of unfortunate circumstances— for example, you lose your profile, you forget your password and a systems administrator has to reset it, the system’s OS fails and you need to recover files directly from the nowdead system’s hard disk—you can simply restore your EFS key by double-clicking the .pfx file and running the resulting wizard. As soon as the wizard is finished, you’ll be able to get to your files again.

Make Yourself a Recovery Agent
But what if you’re the administrator of this system, and you have to think of your users? You might not trust your users to back up their EFS keys, and you’d hate to see the look on their faces when they lose their keys and you’re forced to say, “I can’t help you.” To avoid that, make yourself a recovery agent for the standalone (non-domain-joined) system. (A recovery agent can decrypt files even if he or she didn’t create them.) And this is important: Do so before people start encrypting files. In my experience, a recovery agent can decrypt any files created after he or she became a recovery agent—not before. You can make any user—administrator or not—into a recovery agent, but for this example I’ll assume you’re making yourself the recovery agent. The following process works equally well for Windows Vista, Windows Server 2003, and Windows XP.

First, execute the Cipher /r:recoveryguy command, which creates two certificate files: recoveryguy.cer and recoveryguy. pfx. Cipher will prompt you to create a password for the .pfx file, which contains a private key and needs some protection. Anyone can run this command because all it does is create this pair of certificates. In essence, a user running this command creates a self-identifying ID card (i.e., the .pfx file) and an assurance of trustworthiness to EFS that the user can decrypt any and all files on this system (i.e., the .cer file). None of that’s worth a darn unless an administrator hands this “letter of introduction” to EFS.

In the second step, the soon-to-be data recovery agent (that’s you) needs to associate himself or herself with the newly created .pfx file. Double-click the recoveryguy.pfx file to start the Certificate Import Wizard. After clicking Next twice, the wizard will ask you for the password to the private key on the certificate. Fill in the password you told Cipher /r to use. Also, select the Mark this key as exportable check box (so that you can back up the certificate if necessary), and click Next. Click Next to let the wizard store the certificate, and click Finish.

Finally, in the third step, you’ll give that letter of introduction to the OS. Ensure that you’re logged on with an administrative account, and start up the local Group Policy Editor (GPE). Navigate to Local Computer Policy, Windows Settings, Security Settings, Public Key Policies, Encrypting File System. Right-click the Encrypting File System folder, and choose Add Data Recovery Agent. Doing so starts another wizard. Click Next to get to the Select Recovery Agents page. Click Browse Folders, and navigate to recoveryguy.cer. After you choose that file and click Yes, you’ll see that Windows has accepted the certificate, but that it has the name USER_UNKNOWN. Don’t worry: That’s normal. Click Next, then Finish.

Freely Decrypt
From this point forward, you can examine and decrypt anything encrypted by anyone on this system. Remember, if you’re the only user of a standalone (non-domain-joined) system, you just need to back up your EFS key. But if you’re the administrator of a system that more than one person uses, you need to do a bit more clicking and make yourself a data recovery agent. Or you can simply join those systems to a domain, and the work is already done for you!

End of Article



Reader Comments
Had a USB drive that I move between 2 machines. Due to company policy, the contents of any USB drive connected to laptop are encrypted. This technique let me export/import my keys to the 2nd machine and continue to access the data . Appreciate the tip.

ajrinaldi February 07, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

VMware and the Future of Virtualization

What's next for virtualization and business IT? Windows IT Pro senior editor Jeff James speaks with VMware President and CEO Diane Greene on the future of virtualization technology. ...

What service packs and fixes are available?

...


Windows OSs Whitepapers Replay for Exchange: Enterprise Protection and an Affordable Price

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Disaster Recovery and Backup

A Guide to Windows Certification and Public Keys

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Critical Challenges of ESI & Email Retention
Are you storing too much electronic information? Get expert legal advice and better understanding of what you are required to do as an IT professional.

Become a fan of Windows IT Pro on Facebook!
Join us on Facebook and be a fan of Windows IT Pro!

Sustainable Compliance: Are You Having a Resource Crisis?
Read this white paper to examine trends in compliance and security management and review approaches to reducing the cost and operational burden of compliance.

Rev Up Your IT Know-How with Our Recharged Magazine!
The improved Windows IT Pro provides trusted IT content with an enhanced new look and functionality! Get comprehensive coverage of industry topics, expert advice, and real-world solutions—PLUS access to over 10,000 articles online. Order today!

Get It All with Windows IT Pro VIP
Stock your IT toolbox with every solution ever printed in Windows IT Pro and SQL Server Magazine plus bonus Web-exclusive content on hot topics. Subscribe to receive the VIP CD and a subscription to your choice of Windows IT Pro or SQL Server Magazine!



Order Your Fundamentals CD Today!
Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.
Windows IT Pro Home Register About Us Affiliates / Licensing Media Kit Contact Us/Customer Service  
SQL Connected Home IT Library SuperSite FAQ Wininfo News
Europe Edition Office & SharePoint Pro Windows Dev Pro Windows Excavator 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing