EDN Admin
Well-known member
Hello!<br/> <br/> Ill get right to the point. I am trying to write a program in C# (or VB) that encrypts 2 folders (downloads and documents) using EFS (Encrypting file system). This seems easy enough by simply doing something like this: encryptFile.Encrypt(); where encrypted file is a New FileInfo("directory"). Here is my issue, I have to rely on the end user to click a balloon to start entering their information. I really wish to avoid this.<br/> <br/> Here is how I want this to work<br/> -A new user gets an account on our domain and logs into a computer for the first time using their Smart Card<br/> -My program runs and they enter all their information into the form (I.E. Pin Number)<br/> -Then, using the card that is inserted and pin information it encrypts the folder using EFS.<br/> <br/> When I first started this little endeavor it seemed like this wouldnt be too hard. EFS is built in and I CAN encrypt using it. It became far trickier when I started needing it all to be self contained. <br/> <br/> So far I have the following:<br/> <br/> using System;<br/> using System.Security.Cryptography;<br/> using System.Security.AccessControl;<br/> using System.Text;<br/> using System.IO;<br/> <br/> <br/> <br/> namespace SmartCard<br/> {<br/> class program<br/> {<br/> static void Main(string[] args)<br/> {<br/> FileInfo encryptFile = new FileInfo(@"directory");<br/> <br/> CspParameters csp = new CspParameters(1, "ActivClient Cryptographic Service Provider");<br/> csp.Flags = CspProviderFlags.UseDefaultKeyContainer;<br/> <br/> RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp);<br/> <br/> encryptFile.Encrypt();<br/> }<br/> }<br/> }<br/> <br/> This works pretty great until the last part. It knows to use ActivClient and it will take a pin. What I need is to send that information to "encryptFile.Encrypt();" and have EFS use the credentials that are logged in with out the user having to leave my form. This also needs to be done with EFS because that is an authorized encryption mehtod by the US Army.<br/> <br/> I have been working on this for about a week now and it is making me pull my hair out! Any help would be greatly appreciated
<br/> <br/> Thank you,<br/> Mike<br/> <br/> <br/> <br/>
View the full article

View the full article