Here is some simple code to test it...
Main Topics
Browse All TopicsHello,
I need to copy an EFS encrypted file with C++ CLI, but have not been able to find any examples for this language. I am still researching, but hoped that someone can help.
Thanks,
Mike
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I provided the incorrect link to the original code. It is at SourceForge at the following link:
https://sourceforge.net/pr
I have posted a reference there to this code so the authors can decide whether they want to use it for anything.
Just a note to future PAQ searchers:
The file owner, that is the Windows User who used EFS to encrypt the files, can use standard techniques to copy or move files and directories.
This solution uses OpenEncryptedFileRaw, ReadEncryptedFileRaw, and so forth and that would be useful for basically one operation: When a different Windows User needs to backup encrypted data while leaving it encrypted.
If the goal is to simply copy or move an EFS encrypted file from one place to another, the simplest solution would be login as the owning user. The technique described here comes into play only when a different windows user (e.g., a backup operator) needs to copy files without being able to read the content.
Business Accounts
Answer for Membership
by: mjgardnePosted on 2009-10-17 at 18:47:44ID: 25598408
Arggg... I couldn't find anything online, so I burned the midnight oil and FINALLY got things working with C++ CLI. I'll post the example code here so it may help others. This code is a translation from C# for code that was posted by deceed under GPL license here:
rp/ fidD57D E168AACD13 16CDEC470E F8D455FF02 E35803.asp x? s=Encryp tedRaw
http://www.koders.com/csha
My version is posted under GPL license, too.
Hope it helps someone...
Mike
P.S. My version is a direct translation, with a few tweaks due to C++ CLI particulars. It has not been written in an optimized and production code manner... It is purely a study to build upon.
Select allOpen in new window