파일시스템
2011.03.17 13:41

EFS Internals

조회 수 112694 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제

EFS Internals

EFS uses symmetric key encryption in combination with public key technology to protect files. File data is being encrypted with symmetric algorithm (DESX). The key, used in symmetric encryption is called File Encryption Key (FEK). The FEK in its own turn is encrypted with a public/private key algorithm (RSA) and stored along with the file. The reason why two different algorithms are used is the speed of encryption. The performance burden of asymmetric algorithms is too much to use them for encrypting a large amount of data. Symmetric algorithms are about 1000 times faster making their suitable for encrypting of large amounts of data.

As a first setp to encrypt file, NTFS creates a log file called Efs0.log in System Volume Information folder on the same drive, as encrypted file. Then EFS aquires access CryptoAPI context. It uses Microsoft Base Cryptographic Provider 1.0 as cryptographic provider. Having the crypto context open, EFS generate File Encryption Key (FEK).

The next step is to get public/private key pair; if it does not exist at this stage (the case when EFS invoked first time), EFS generate a new pair. EFS uses 1024-bit RSA algorithm to encrypt FEK.

Then, EFS creates Data Decryption Field (DDF) for the current user, where it places FEK and encrypts it with public key. If recovery agent is defined by system policy, EFS creates also Data Recovery Field (DRF) and places there FEK encrypted with public key of recover agent. A separate DRA is created for every recovery agent defined. Please note, that on Windows XP not included into domain, there's no recovery agent is defined, so this step is omitted.

Now a temporary file Efs0.tmp is created in the same folder as the file being encrypted. The contents of original file (plain text) is copied into temporary file, after that the original is overwritten with encrypted data. By default, EFS uses DESX algorithm with 128-bit key to encrypt file data, but Windows could be also configured to use stronger 3DES algorithm with 168-bit key. In that case FIPS compliant algorithms usage must be turned on in LSA policy (it is disabled by default):

EFS uses the registry to determine if it will use DESX or 3DES. If HKLMSYSTEMCurrentControlSetControlLSAFipsAlgorithmPolicy = 1, then 3DES will be used. If not, then EFS checks HKLMSoftwareMicrosoftWindows NTCurrentVersionEFSAlgorithmID (this value may not be present); if present, it will have ID CALG_3DES or CALG_DESX, otherwise, DESX should be used.

After encryption is done, temporary and log files are deleted.

 

After file is encrypted, only users who has correspondent DDF or DRF can access the file. This mechanism is separate from common security meaning that beside rights to access file, the file must have its FEK encrypted with user's public key. Only user who can decrypt FEK with his own private key, can access the file. The consequence is, that user, who has access to the file, can encrypt it thus preventing the owner to access his own file. Initially only one DDF is created for user who encrypts the file, but later he can add extra users to key ring. In this case EFS simply decrypts FEK with private key of user who wants to give access to the file to another user, and encrypts FEK with public key of target user, thus creating a new DDF which is stored along with the first one.

The decryption process is opposite to encryption:

First, system checks if user has a private key used by EFS. If yes, it reads EFS attributes and walk through the DDF ring looking for DDF for current user. If DDF is found, user's private key is used to decrypt FEK extracted from DDF. Using decrypted FEK, EFS decrypts file data. It should be noticed that file never decrypted in whole but rather by sectors when upper level module requests particular sector.

Recovery process is similar to decryption, except that it uses the recovery agent's private key to decrypt the FEK in the DRF, not in DDF:

DRA policy is implemented differently for Windows 2000 and Windows XP. In Windows 2000 by default on computers, not included into domain, local Administrator is added to Public Key Policy as Encrypted Data Recovery Agent. So, when user encrypts file, both DDF and DRF fields are created. If the last DRA is deleted, the whole EFS functionality is turned off and it is not possible to encrypt file anymore.

In Windows XP the situation is different. Since majority of home users working standalone do not need anybody else to be able to decrypt file except themselves, there's no need in data recovery agents, so there's no DRA included into Public Key Policy and EFS works without DRA. In this case only DDF field is created for encrypted file.

?

  1. MALWARE MAINTENANCE

    Date2013.06.29 CategoryPC관리 Byadmin Views365224
    Read More
  2. hfs+ 개요

    Date2011.03.19 Category파일시스템 Byadmin Views173062
    Read More
  3. EFS Internals

    Date2011.03.17 Category파일시스템 Byadmin Views112694
    Read More
  4. Digital Forensic 의 정의

    Date2011.03.19 Category포렌식 Byadmin Views102542
    Read More
  5. FAT 파일시스템 FAT32 테이블 살펴보기

    Date2011.03.16 Category파일시스템 Byadmin Views17075
    Read More
  6. 하드디스크란?

    Date2017.03.14 Category기타 Bymaster Views11673
    Read More
  7. NTFS Optimization

    Date2011.03.17 Category파일시스템 Byadmin Views9388
    Read More
  8. DISK MAINTENANCE

    Date2013.06.29 CategoryPC관리 Byadmin Views8926
    Read More
  9. ext2 개요

    Date2011.03.19 Category파일시스템 Byadmin Views6037
    Read More
  10. 플래시메모리의 장애원인과 복구절차

    Date2011.03.14 Category메모리 Byadmin Views5140
    Read More
  11. 하드디스크 주요 장애원인 및 복구절차

    Date2011.03.14 Category하드디스크 Byadmin Views5082
    Read More
  12. 플래시메모리란?

    Date2017.03.15 Category기타 Bymaster Views4479
    Read More
  13. 레이드의 구성종류

    Date2017.03.16 Category레이드 Bymaster Views4278
    Read More
  14. NTFS vs FAT

    Date2011.03.17 Category파일시스템 Byadmin Views4183
    Read More
  15. EXT3 개요

    Date2011.03.19 Category파일시스템 Byadmin Views2551
    Read More
  16. 낸드 플래시 서비스 가능 메모리

    Date2013.06.07 Category메모리 Byadmin Views2529
    Read More
  17. ONFI 란

    Date2013.06.28 Category기타 Byadmin Views2468
    Read More
  18. EXFAT 개요

    Date2011.09.26 Category파일시스템 Byadmin Views2365
    Read More
  19. 포맷 후 복구

    Date2013.06.22 CategoryDIY복구 Byadmin Views2167
    Read More
  20. 이메일이란?

    Date2017.03.14 Category기타 Bymaster Views2103
    Read More
Board Pagination Prev 1 2 3 4 5 6 Next
/ 6