{"id":634,"date":"2018-12-26T23:35:00","date_gmt":"2018-12-27T07:35:00","guid":{"rendered":"https:\/\/kb.terabyteunlimited.com\/kb-articles\/disk-encryption-and-image-for-windows\/"},"modified":"2021-09-09T22:05:48","modified_gmt":"2021-09-10T05:05:48","slug":"disk-encryption-and-image-for-windows","status":"publish","type":"lsvr_kba","link":"https:\/\/www.terabyteunlimited.com\/kb\/kb-articles\/disk-encryption-and-image-for-windows\/","title":{"rendered":"Disk Encryption and Image for Windows"},"content":{"rendered":"<p>This article provides general information on how Image for Windows and PHYLock handle disk encryption. If you are using BitLocker or VeraCrypt\/TrueCrypt please refer to the appropriate article linked below. Note that it may be helpful to read through these articles even if not using VeraCrypt\/TrueCrypt or BitLocker to have a better understanding of how disk encryption affects imaging.<\/p>\r\n<ul>\r\n\t<li><a href=\"https:\/\/www.terabyteunlimited.com\/kb\/?p=616\">Using BitLocker with TeraByte's Imaging Programs<\/a><\/li>\r\n\t<li><a href=\"https:\/\/www.terabyteunlimited.com\/kb\/?p=462\">Using VeraCrypt\/TrueCrypt with TeraByte's Imaging Programs<\/a><\/li>\r\n<\/ul>\r\n<p>Depending on the how the encryption program is installed and how it functions, it may be possible to back up some partitions in the decrypted state using Image for Windows in Windows. For example, you may be able to back up the Windows partition in the decrypted state, but not separate data partitions, which may be seen as RAW. If the encryption program supports VSS you may be able to use it instead of PHYLock to create backups in the decrypted state (BitLocker is an example of this).<\/p>\r\n<p>In many cases, the encryption driver is installed to <em>UpperFilters<\/em>. This driver is required to provide on-the-fly encryption and decryption of the system partition or system drive. It is installed to the <em>UpperFilters<\/em> list of the <em>DiskDrive<\/em> class (GUID 4D36E967-E325-11CE-BFC1-08002BE10318). The driver is usually inserted at the beginning of the list, before any existing entries.<\/p>\r\n<p>The list of <em>UpperFilters<\/em> drivers can be found at the following registry location: <span style=\"color: #009900;\">HKEY_LOCAL_MACHINE&#92;SYSTEM&#92;CurrentControlSet&#92;Control&#92;Class&#92;{4D36E967-E325-11CE-BFC1-08002BE10318}<\/span><\/p>\r\n<p>A standard Windows installation may only have <em>PartMgr<\/em> listed. In this case, after system encryption is enabled, <em>UpperFilters<\/em> may be (<em>encryptiondriver<\/em> is used here as an example): <em><span style=\"color: #009900;\">encryptiondriver PartMgr<\/span><br \/>\r\n<\/em><br \/>\r\nThe order of the <em>UpperFilters<\/em> list is especially important when PHYLock is installed because it affects whether or not PHYLock sees encrypted or decrypted data.<\/p>\r\n<p>Image for Windows can be installed either before or after system encryption is enabled. By default, the PHYLock driver (used by Image for Windows to image live partitions) is installed to the <em>UpperFilters<\/em> of the <em>DiskDrive<\/em> class just before <em>PartMgr<\/em>. This means that the placement of PHYLock in the list of drivers does not change depending on the existence of the encryption driver. For example, on a typical VeraCrypt system, <em>UpperFilters<\/em> would be: <em><span style=\"color: #009900;\">veracrypt phylock PartMgr<\/span><\/em><\/p>\r\n<p>With PHYLock listed <u>before<\/u> the encryption driver, Image for Windows will back up encrypted data because the data has not yet been decrypted by the encryption driver. This has a profound effect on how Image for Windows functions. This type of system will be referred to as <strong>PHYLock 1st<\/strong>. Note that when configured this way, Image for Windows in Windows sees the drive the same as it would outside Windows (e.g. from TBWinPE\/RE) \u2014 the same as Image for Linux or Image for DOS.<\/p>\r\n<p>With PHYLock listed <u>after<\/u> the encryption driver, Image for Windows will back up decrypted data because the encryption driver has decrypted it before PHYLock sees it. In most aspects, a backup of this type is the same as a normal backup where encryption is not involved. This type of system will be referred to as <strong>PHYLock 2nd<\/strong>.<\/p>\r\n<p><strong><em>Comparison of the PHYLock 1st and PHYLock 2nd Methods<\/em><\/strong><\/p>\r\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\r\n<tbody>\r\n<tr style=\"border: 1px solid black;\" bgcolor=\"#ffffcc\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>\u00a0<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p><strong>PHYLock 1st<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p><strong>PHYLock 2nd<\/strong><\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>File System<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>The file system cannot be seen so all sectors must be included in the backup<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Used sectors can be backed up because the file system can be seen<\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>File Exclusion<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Not possible<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Paging &amp; hibernation files can be excluded<\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>Compression<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>None<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Functions normally<\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>PHYLock<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>PHYLock may fail to cache all changes to the drive<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Functions normally<\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>Image Size<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>The size of the partition\/drive being backed up<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Equivalent to those taken if encryption was not used<\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" bgcolor=\"#ffffcc\" width=\"213\">\r\n<p><strong>Time Required<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Greatly increased<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>Normal<\/p>\r\n<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p>&nbsp;<\/p>\r\n<h2><span style=\"color: #333399;\">Backing up from Windows \u2014 PHYLock 1st<\/span><\/h2>\r\n<p>The PHYLock 1st method of backing up from Windows allows the system-encrypted partitions to be backed up in their encrypted state (similarly to backing up outside Windows). Since this is not the default method, using it requires manually changing the order of the <em>encryptiondriver<\/em> and <em>phylock<\/em> drivers in the <em>UpperFilters<\/em> of the <em>DiskDrive<\/em> class.<\/p>\r\n<p>Proceed as follows to modify the <em>UpperFilters<\/em> value:<\/p>\r\n<ul>\r\n\t<li>Start the Registry Editor (regedit.exe).<\/li>\r\n\t<li>Browse to the following key: <span style=\"color: #009900;\">HKEY_LOCAL_MACHINE&#92;SYSTEM&#92;CurrentControlSet&#92;Control&#92;Class&#92;{4D36E967-E325-11CE-BFC1-08002BE10318}<\/span><\/li>\r\n\t<li>Right-click on the <em>UpperFilters<\/em> value and select <strong>Modify...<\/strong>\u00a0from the context menu.<\/li>\r\n\t<li>The drivers will be listed one per line. Edit the list and place <em>phylock<\/em> before <em>encryptiondriver<\/em>. This can be done using cut &amp; paste or by typing.<br \/>\r\n<strong><span style=\"color: #ff0000;\">Important:<\/span><\/strong> Do not change the order of any other drivers in the list. Do not remove any drivers from the list. Making any incorrect or invalid changes will very likely cause Windows to fail during boot-up with a BSOD.<\/li>\r\n\t<li>Click <strong>Ok<\/strong> to save the changes. Make sure the list is shown correctly in the display.<\/li>\r\n\t<li>Close the Registry Editor.<\/li>\r\n\t<li>Restart Windows.<\/li>\r\n<\/ul>\r\n<p>A before and after example of a typical system is shown below:<\/p>\r\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\r\n<tbody>\r\n<tr style=\"border: 1px solid black;\" bgcolor=\"#ffffcc\">\r\n<td valign=\"top\" width=\"213\">\r\n<p><strong>Registry Value<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p><strong>Before<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p><strong>After<\/strong><\/p>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"border: 1px solid black;\">\r\n<td valign=\"top\" width=\"213\">\r\n<p><strong>UpperFilters<\/strong><\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>encryptiondriver phylock PartMgr<\/p>\r\n<\/td>\r\n<td valign=\"top\" width=\"213\">\r\n<p>phylock encryptiondriver PartMgr<\/p>\r\n<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p>The option of creating an image in the encrypted state directly from Windows can be appealing for a number of reasons, including being easily scheduled and that restoring doesn't require re-encrypting the drive. However, it is important to understand there potential problems and increased risk involved with this type of backup.<\/p>\r\n<p>To help prevent PHYLock from failing during the backup, it is recommended to keep disk activity to a minimum. PHYLock has to buffer all changes to the underlying encrypted partition. Excess changes may cause PHYLock to fail. If this happens, the partition is not corrupted or damaged, but the backup image is and will be deleted by default.<\/p>\r\n<p>A byte-for-byte validation (<em>Validate Byte-for-Byte<\/em> option) will almost always fail when backing up an encrypted partition from Windows. This failure is for the same reason as when backing up unused sectors (<em>Backup Unused Sectors<\/em> option) \u2014 the backup may include the cache of changes, which may change by the time the backup is complete and the validation is run. If the cached changes haven't changed by the time Image for Windows gets to the point of validating them, the byte-for-byte validation will pass. PHYLock will use disk space or RAM for the cache (options for which can be changed in Image for Windows settings). The disk cache does not have to be on the same partition that is being backed up, but it must be on the same physical drive. This means that a backup of an encrypted partition will not cache to the encrypted partition (because it's seen as RAW), but will instead cache to another location on the drive or to RAM if it cannot access the drive. Disk changes are written immediately to the drive and the old data is cached \u2014 the cache cannot be cached or it would cause a never ending loop. In this case, a failed byte-for-byte validation does not necessarily mean the backup image itself is corrupt (however, it would still be deleted by Image for Windows unless the option to keep failed backups is enabled). If you require absolute byte-for-byte validation, the encrypted partition must be unmounted at the time of the backup and PHYLock cannot be used (back up from Image for Linux, Image for DOS, or Image for Windows from TBWinRE\/TBWinPE).<\/p>\r\n<p>Any errors in the backup that are not caught by Image for Windows may render the entire backup corrupt. When restored, the partition may unmountable or may not be able to properly decrypt the data if mounting succeeds. The computer system needs to be able to process the backup from start to finish with 100% accuracy to ensure the validity of this type of backup. Marginal systems are very likely to create corrupted images.<\/p>\r\n<p>It is recommended to create additional backups, either from outside Windows or using the PHYLock 2nd method, and not to rely solely on the PHYLock 1st backups to provide access to your data in the event of a system failure. It is also recommended to create an image of the entire drive instead of the individual partitions, if possible.<\/p>\r\n<p>Backup images if this type cannot be accessed using TBIView and TBIMount.<\/p>\r\n<h2><span style=\"color: #333399;\">Backing up from Windows \u2014 PHYLock 2nd<\/span><\/h2>\r\n<p>The PHYLock 2nd method of backing up system encrypted partitions from Windows allows Image for Windows to see the partitions normally, in the decrypted state. This is the default method. As when backing up standard unencrypted partitions, Image for Windows is able to apply compression, back up only the used sectors, and exclude the paging and hibernation files. This results in image files the same size as if no encryption were used. In addition, backup images can be viewed using TBIView or mounted using TBIMount, allowing files to be extracted normally.<\/p>\r\n<p>If encryption is required in the backup image, the <em>Encrypt Data<\/em> option can be selected to encrypt the image with 256-bit AES encryption (note that you must also specify a password). This option provides an easy way to keep the data being imaged secure while still providing easy access and smaller image sizes. Alternatively, you can save the backup to another mounted encrypted partition.<\/p>\r\n<h2><span style=\"color: #333399;\">Restoring Images taken in the Encrypted State<\/span><\/h2>\r\n<p>Images created in the encrypted state (either from outside Windows or by using the PHYLock 1st method) cannot be successfully restored while in Windows. These types of restores must be done using Image for Linux, Image for DOS, or Image from Windows in TBWinRE\/TBWinPE.<\/p>\r\n<p>Some types of encrypted partitions cannot be restored to an alternate location. For example, they must be restored to the same sectors on the same drive. When the partition is moved, the encryption program will still look in the original location and decryption will fail.<\/p>\r\n<p>It may be necessary to use certain restore options to allow the restore to be successful. Be prepared to do thorough testing to determine appropriate options needed or if this type of backup\/restore is even feasible.<\/p>\r\n<h2><span style=\"color: #333399;\">Restoring Images taken using PHYLock 2nd<\/span><\/h2>\r\n<p>An image created using the PHYLock 2nd method contains the decrypted data. Restoring this image will restore the decrypted data (i.e. data is no longer encrypted). Encryption would need to be activated again to encrypt the drive.<\/p>\r\n<p>When restoring the system drive to the decrypted state, it may be necessary to select the <em>Write Standard MBR Code <\/em>option and the <em>Update Boot Partition<\/em> option and\/or the Update <em>BOOT.INI<\/em> option. Some systems may require a boot repair before they will boot successfully into Windows.<\/p>\r\n<h2>\u00a0<\/h2>","protected":false},"excerpt":{"rendered":"<p>This article provides general information on how Image for Windows and PHYLock handle disk encryption. If you are using BitLocker or VeraCrypt\/TrueCrypt please refer to the appropriate article linked below. Note that it may be helpful to read through these articles even if not using VeraCrypt\/TrueCrypt or BitLocker to have a better understanding of how [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"lsvr_kba_cat":[1796],"lsvr_kba_tag":[2121],"class_list":["post-634","lsvr_kba","type-lsvr_kba","status-publish","hentry","lsvr_kba_cat-general-information-image-for-windows","lsvr_kba_tag-image-for-windows"],"_links":{"self":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/comments?post=634"}],"version-history":[{"count":3,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/634\/revisions"}],"predecessor-version":[{"id":6592,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/634\/revisions\/6592"}],"wp:attachment":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/media?parent=634"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_cat?post=634"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_tag?post=634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}