Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most secure way to retrieve the system Drive

I know that the following should work:

Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine) 

My problem with this call is that if for some reason someone decided to remove the "windir" Env Var , this won't work.

Is there an even more secure way to get the System drive?

like image 675
user88637 Avatar asked May 26 '09 10:05

user88637


People also ask

What is the most secure way to wipe a hard drive?

DBAN, Darik's Boot And Nuke, is the most reliable, secure way to wipe a hard drive for free. It is easily equal to many very expensive data security programs and is free and open source. You will need to download the file and burn it to a DVD or USB drive before use but aside from that is very simple to use.

How do you secure data on a hard drive?

Encrypted hard drive architectureEncrypted hard drives utilize two encryption keys on the device to control the locking and unlocking of data on the drive. These are the data encryption key (DEK) and the authentication key (AK). The Data Encryption Key is the key used to encrypt all of the data on the drive.

Which locker should be used to protect data in hard drive?

BitLocker is designed to be used with a Trusted Platform Module. This is a tamper-resistant chip built in to new PCs that can store your disk encryption key. Because BitLocker keys are stored in the TPM (by default) you're not required to enter a passphrase when booting up.

What is encrypted hard drive?

Hard-drive encryption is a technology that encrypts the data stored on a hard drive using sophisticated mathematical functions. Data on an encrypted hard drive cannot be read by anyone who does not have access to the appropriate key or password.


1 Answers

string windir = Environment.SystemDirectory; // C:\windows\system32
string windrive = Path.GetPathRoot(Environment.SystemDirectory); // C:\

Note: This property internally uses the GetSystemDirectory() Win32 API. It doesn't rely on environment variables.

like image 61
Serge Wautier Avatar answered Oct 19 '22 21:10

Serge Wautier