How to programmatically create a partition?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

In one of my current projects, I am willing to create a secure zone such as
Acronis does in its application to store some confidential information only
accessible to the current machine user.

I know that .Net doesn't provide such functionalities therefore I went on
MSDN Library and also on Google to look for any solution with no result...

I first guessed that using WMI it could be doable (System.Management
namespace) but it only provides a way to retrieve information...

I then looked at interop but I couldn't find any library that could do the
job for me...

Now, comes my question, what would be your guess to handle this
functionality in my program...? I don't care if it has to be written in
unmanaged code as my current client users are binded to Windows
environments...

Thanks

Amadrias
 
Amadrias said:
Hi,

In one of my current projects, I am willing to create a secure zone such as
Acronis does in its application to store some confidential information only
accessible to the current machine user.

I know that .Net doesn't provide such functionalities therefore I went on
MSDN Library and also on Google to look for any solution with no result...

Did you check out isolated storage?

"Isolated Storage"
http://msdn.microsoft.com/library/d...y/en-us/cpguide/html/cpconIsolatedStorage.asp

"Manage User Settings in Your .NET App with a Custom
Preferences API"
http://msdn.microsoft.com/msdnmag/issues/04/07/custompreferences/


this may also be of interest:

How To Create a DPAPI Library
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetht07.asp

I first guessed that using WMI it could be doable (System.Management
namespace) but it only provides a way to retrieve information...

I then looked at interop but I couldn't find any library that could do the
job for me...

Now, comes my question, what would be your guess to handle this
functionality in my program...? I don't care if it has to be written in
unmanaged code as my current client users are binded to Windows
environments...

Thanks

Amadrias



'Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.'
Martin Fowler,
'Refactoring: improving the design of existing code', p.15
 
First thanks for this quick answer...

Unfortunatelly, this doesn't match my client requirements:

On the storage location, I knew that IsolatedStorage could provide me a good
place to store preferences data. Now, this doesn't provide a real secured
zone as if you are an administrator, you still can have access to the
isolated storage locations and manipulate the files which is something my
client doesn't want them to be able to do.

The unique way I can answer my client requirements is to programmatically
create a new partition on a hard drive or even in a removable storage and
then, make this partition not available to windows...

And I need a hand on this part...

Thanks,

Amadrias
 
Just to add some information...

I've found an open source project that provides the kind of features I am
looking for:
http://truecrypt.sourceforge.net/

However, the overall is compiled in a single .exe file and not shared as a
..dll that I could therefore import within my project...

Amadrias
 
Amadrias said:
First thanks for this quick answer...

Unfortunatelly, this doesn't match my client requirements:

On the storage location, I knew that IsolatedStorage could provide me a good
place to store preferences data. Now, this doesn't provide a real secured
zone as if you are an administrator, you still can have access to the
isolated storage locations and manipulate the files which is something my
client doesn't want them to be able to do.

The unique way I can answer my client requirements is to programmatically
create a new partition on a hard drive or even in a removable storage and
then, make this partition not available to windows...

And I need a hand on this part...

I've found an open source project that provides the kind of features I am
looking for:
http://truecrypt.sourceforge.net/

However, the overall is compiled in a single .exe file and not shared as a
.dll that I could therefore import within my project...

Amadrias
Looks like you have an uneviable task ahead of you...

Because your client's real vulnerabilty is the lack of trust
in the administrator.

10 Immutable Laws of Security
http://www.microsoft.com/technet/archive/community/columns/security/essays/10imlaws.mspx

Law #6: A computer is only as secure as the administrator is
trustworthy

Lets face it, that data will have to be unencrypted at some
point of time to be useful and thats when somebody
sufficiently competent and motivated can get at it
especially with administrator privileges.


You could simply write a wrapper class for truecrypt and use
it through the Process class.
http://msdn.microsoft.com/library/d...l/frlrfsystemdiagnosticsprocessclasstopic.asp

however that would still leave your unencrypted data
vulnerable in your process memory and possibly the paging
file.


Creating a partiton on the disk is a pretty low level
operation - you may simply want to defer that to an
"pre-installation requirement" that there has to an
existing, usable (formatted) partition. Most systems are
delivered fully partitoned and your don't want to have to
reinvent something like "Partition Magic" to shrink an
existing partition to make room for the hidden partition.

That still leaves the unhiding and hiding of the partition
before and after use and all the problems that might entail
through the file system...
A removable 1 GB USB jumpdrive is starting to look real
good...

Good Luck


'Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.'
Martin Fowler,
'Refactoring: improving the design of existing code', p.15
 
You can always encrypt the contents of the folder and/or files you create
using the user key and DPAPI. An admin cannot read the contents of user
encrypted folders.

Shariq Khan
(e-mail address removed)
 
Amadrias said:
Just to add some information...

I've found an open source project that provides the kind of features I am
looking for:
http://truecrypt.sourceforge.net/

However, the overall is compiled in a single .exe file and not shared as a
.dll that I could therefore import within my project...

That's only if you use the compiled exe, however. The project is open
source, so presumably you could compile it to a DLL yourself.
 
Law #6: A computer is only as secure as the administrator is
trustworthy

Lets face it, that data will have to be unencrypted at some
point of time to be useful and thats when somebody
sufficiently competent and motivated can get at it
especially with administrator privileges.

<snip>

While that's true of computer security *in general*, it's not
necessarily true of all data stored on a computer. If I encrypt a
message with a pass phrase (using a suitably secure algorithm, of
course), and that pass phrase itself is only stored in my head, you
could be the administrator of whatever computer you want - you still
won't be able to get the plaintext without knowing the pass phrase.
 
Jon Skeet said:
<snip>

While that's true of computer security *in general*, it's not
necessarily true of all data stored on a computer. If I encrypt a
message with a pass phrase (using a suitably secure algorithm, of
course), and that pass phrase itself is only stored in my head, you
could be the administrator of whatever computer you want - you still
won't be able to get the plaintext without knowing the pass phrase.

That wasn't my point. You are simply referring do the data
in its encrypted state - but somebody with administrative
privileges has the means to disclose your secrets when YOU
are working with them in their UNENCRYPTED state.

The key phrase here is "sufficiently competent and
motivated". An attacker with local administrator privileges
could install utilities to snap shot your process memory
and/or paging file to capture your unencrypted secrets. A
network administrator could do the same remotely. This puts
additional pressure on the developer to keep the unencrypted
secrets from being swapped to the paging file, erasing any
buffer memory used and to leave secrets unencrypted for the
shortest possible window inside the application. However the
secrets remain vulnerable while they are being displayed to
the user in the clear.

So you could say "it IS necessarily true for all data USED
on the computer".
 
UAError said:
That wasn't my point. You are simply referring do the data
in its encrypted state - but somebody with administrative
privileges has the means to disclose your secrets when YOU
are working with them in their UNENCRYPTED state.

You're assuming that the unencrypted data is ever present on the
computer. I could email you an encrypted file, and whatever rights you
have on your computer, you wouldn't be able to decrypt it. There's
nothing to say that I would then need to decrypt it at any stage on
your computer. You could keep it for me and then pass it back to me for
decryption on my trusted computer at a later date.
 
Jon Skeet said:
You're assuming that the unencrypted data is ever present on the
computer. I could email you an encrypted file, and whatever rights you
have on your computer, you wouldn't be able to decrypt it. There's
nothing to say that I would then need to decrypt it at any stage on
your computer. You could keep it for me and then pass it back to me for
decryption on my trusted computer at a later date.

Again you are entirely missing the point. Your scenario is
sound simply because the data is never decrypted. Here I'm
not concerned with the administrators of the machines where
the encrypted data resides - though they still have ample of
opportunity for brute force attacks.

I was concerned with the administrators of the machines
where the data is being encryted, decrypted and worked with.

So you still have to be able to TRUST the administrator of
your TRUSTED computer - otherwise your are vulnerable to
"eavesdropping"/"monitoring" while you work with your
(unencrypted) precious secrets. There is no point of having
encrypted data that will never be decrypted - you might as
well destroy it.
 
UAError said:
Again you are entirely missing the point. Your scenario is
sound simply because the data is never decrypted. Here I'm
not concerned with the administrators of the machines where
the encrypted data resides - though they still have ample of
opportunity for brute force attacks.

I was concerned with the administrators of the machines
where the data is being encryted, decrypted and worked with.

So you still have to be able to TRUST the administrator of
your TRUSTED computer - otherwise your are vulnerable to
"eavesdropping"/"monitoring" while you work with your
(unencrypted) precious secrets. There is no point of having
encrypted data that will never be decrypted - you might as
well destroy it.

Yes, you have to trust the administrator of the trusted computer. That
much I wouldn't deny. I was only disagreeing with your idea that if you
store data on any computer in any way, and that computer has an
untrustworthy administrator, your data is insecure. My scenario is a
counter-example to that.
 
Back
Top