Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS8: File System 8.3. Encrypting File System Security.

Slides:



Advertisements
Similar presentations
Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb
Advertisements

Rambling on the Private Data Security
Public Key Infrastructure A Quick Look Inside PKI Technology Investigation Center 3/27/2002.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
DESIGNING A PUBLIC KEY INFRASTRUCTURE
Windows XP File System Management Group D. 3 Layers of Drivers Filter Drivers Filter Drivers –Virus protection, compression, encryption File System Drivers.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 7: Advanced File System Management.
Presented by Xiaoping Yu Cryptography and PKI Cosc 513 Operating System Presentation Presented to Dr. Mort Anvari.
About PKI Key Stores Dartmouth College PKI Lab. Key Store Defined Protected “vault” to hold user’s private key with their copy of their x.509 certificate.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Public Key Infrastructure – Deep Dive PKI session SHOWING you how to embrace PKI Steve Lamb
70-270, MCSE/MCSA Guide to Installing and Managing Microsoft Windows XP Professional and Windows Server 2003 Chapter Nine Managing File System Access.
Steve Lamb IT Pro Evangelist Microsoft Ltd What Do I Need To Know About PKI To.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 7: Advanced File System Management.
1 Chapter Overview Managing Compression Managing Disk Quotas Increasing Security with EFS Using Disk Defragmenter, Check Disk, and Disk Cleanup.
File System and Full Volume Encryption Sachin Patel CSE 590TU 3/9/2006.
STANFORD UNIVERSITY INFORMATION TECHNOLOGY SERVICES Windows Encryption File System (EFS) Tech Briefing July 18 th 2008
Encryption Methods By: Michael A. Scott
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography 101 Frank Hecker
Public Key Cryptography July Topics  Symmetric and Asymmetric Cryptography  Public Key Cryptography  Digital Signatures  Digital Certificates.
Computer Security Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 7: Advanced File System Management.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 15 Installing and Using Windows XP Professional.
-Term Project Final Presentation Sang-Ho Lee Dae-Jin Jung.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory Chapter 9: Active Directory Authentication and Security.
Jim McLeod MyDBA  SQL Server Performance Tuning Consultant with MyDBA  Microsoft Certified Trainer with SQLskills Australia 
Week #7 Objectives: Secure Windows 7 Desktop
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 7: Advanced File System Management.
7.3. Windows Security Descriptors
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.5. Lab Slides & Lab Manual.
Network Security. Security Threats 8Intercept 8Interrupt 8Modification 8Fabrication.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Security.  is one of the most widely used and regarded network services  currently message contents are not secure may be inspected either.
Symmetric versus Asymmetric Cryptography. Why is it worth presenting cryptography? Top concern in security Fundamental knowledge in computer security.
1 Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and.
Introduction to Public Key Infrastructure January 2004 CSG Meeting Jim Jokl.
King Mongkut’s University of Technology Faculty of Information Technology Network Security Prof. Reuven Aviv 6. Public Key Infrastructure Prof. R. Aviv,
Unit OS8: File System 8.6. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating.
Chapter 3 (B) – Key Management; Other Public Key Cryptosystems.
Unit OS A: Windows Networking A.4. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS7: Security 7.1. The Security Problem.
Security fundamentals Topic 4 Encryption. Agenda Using encryption Cryptography Symmetric encryption Hash functions Public key encryption Applying cryptography.
Security fundamentals Topic 5 Using a Public Key Infrastructure.
Lecture 18 Windows – NT File System (NTFS)
Windows 2000 Security Yingzi Jin. Introduction n Active Directory n Group Policy n Encrypting File System.
Module 5: Configuring and Managing File Systems. Overview Working with File Systems Managing Data Compression Securing Data by Using EFS.
Deck 10 Accounting Information Systems Romney and Steinbart Linda Batch March 2012.
Managing Applications, Services, Folders, and Libraries Lesson 4.
Microsoft Windows XP Professional MCSE Exam
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS7: Security 7.4. Lab Manual.
1 Objectives Discuss File Services in Windows Server 2008 Install the Distributed File System in Windows Server 2008 Discuss and create shared file resources.
Module 11: Managing Data Storage. Overview Managing File Compression Configuring File Encryption Configuring EFS Recovery Agents Implementing Disk Quotas.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
4.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 12: Implementing Security.
Encryption Name : Maryam Mohammed Alshami ID:H
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 7: Advanced File System Management.
Chapter Objectives In this chapter, you will learn:
e-Health Platform End 2 End encryption
Unit OS7: Security 7.4. Quiz Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze.
Unit OSC: Interoperability
Unit OS11: Performance Evaluation
Unit OS8: File System 8.6. Quiz
Unit OS2: Operating System Principles
Unit OS10: Fault Tolerance
Chapter 3: Windows7 Part 4.
File System Management
Presentation transcript:

Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS8: File System 8.3. Encrypting File System Security in Windows

2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating System Internals Curriculum Development Kit, developed by David A. Solomon and Mark E. Russinovich with Andreas Polze Microsoft has licensed these materials from David Solomon Expert Seminars, Inc. for distribution to academic organizations solely for use in academic environments (and not for commercial use)

3 Roadmap for Section 8.3 Encrypting File System (EFS) Terminology EFS Operation Data Encryption and Decryption Windows EFS Architecture Encryption Process Details

4 Encrypting File System Security EFS relies on Windows cryptography support Transparent encryption through Windows Explorer or cipher-utility

5 EFS operation When a file is encrypted... EFS generates random File Encryption Key (FEK) to encrypt file content Stronger variant of Data Encryption Standard (U.S.: 128/intl.: 56 bit) (symmetric DESX-algorithm) to encrypt file content (fast, shared secret) File‘s FEK is stored with file and encrypted using the file creator‘s RSA public key (slow) File can be decrypted... only with the user‘s private RSA key What about lost keys? FEK can be stored in multiple encryptions... Users can share an encrypted file Can store a recovery key to allow recovery agents access to files Secure public/private key pairs are essential Stored on computer harddisk... (but soon on smartcards)

6 Basic Terminology Plaintext The stuff you want to secure, typically readable by humans ( ) or computers (software, order) Ciphertext Unreadable, secure data that must be decrypted before it can be used Key You must have it to encrypt or decrypt (or do both) Cryptoanalysis Hacking it by using science Complexity Theory How hard is it and how long will it take to run a program

7 Symmetric Key Cryptography Encryption “The quick brown fox jumps over the lazy dog” “AxCv;5bmEseTfid3) fGsmWe#4^,sdgfMwi %” “The quick brown fox jumps over the lazy dog” Decryption Plain-text inputPlain-text output Cipher-text Same key (shared secret)

8 Symmetric Pros and Cons Weakness: Agree the key beforehand Securely pass the key to the other party Strength: Simple and really very fast (order of 1000 to faster than asymmetric mechanisms) Super-fast if done in hardware (DES) Hardware is more secure than software, so DES makes it really hard to be done in software, as a prevention

9 Public Key Cryptography Knowledge of the encryption key doesn’t give you knowledge of the decryption key Receiver of information generates a pair of keys Publish the public key in directory Then anyone can send him messages that only she can read

10 Public Key Encryption Encryption “The quick brown fox jumps over the lazy dog” “Py75c%bn&*)9|fDe^ mdFg$5knvMd’rkveg Ms” “The quick brown fox jumps over the lazy dog” Decryption Clear-text InputClear-text Output Cipher-text Different keys Recipient’s public key Recipient’s private key private public

11 Problem of Key Recovery What if you lose the private key? What if you lose the private key? Data recovery by authorized agents Integrated key management Windows: Flexible recovery policy Enterprise, domain, or per machine Encrypted backup and restore Integrated with Windows backup Potential weakness but you can opt not to use it!

12 Data Encryption Process Data Recovery Field generation (e.g., RSA) DRF Recovery agent’s public key (in certificate) in recovery policy Launch key for nuclear missile “RedHeat” is... Data Decryption Field generation (e.g., RSA) DDF User’s public key (in certificate) RNG Randomly- generated file encryption key (FEK) File encryption (e.g., DES) *#$fjda^j u539!3t t389E 5e%32\^kd

13 *#$fjda^j u539!3t t389E 5e%32\^kd Launch key for nuclear missile “RedHeat” is... Launch key for nuclear missile “RedHeat” is... File decryption (e.g., DES) DDF DDF extraction (e.g., RSA) File encryption key (FEK) DDF is decrypted using the private key to get to the file encryption key (FEK) DDF contains file encryption key (FEK) encrypted under user’s public key User’s private key Data Decryption Process

14 *#$fjda^j u539!3t t389E 5e%32\^kd Launch key for nuclear missile “RedHeat” is... Launch key for nuclear missile “RedHeat” is... File decryption (e.g., DES) DRF DRF extraction (e.g., RSA) DRF contains file encryption key (FEK) encrypted under recovery agent’s public key File encryption key (FEK) DRF is decrypted using the private key of recovery agent to get to the file encryption key (FEK) Recovery agent’s private key Data Recovery Process

15 Windows EFS Architecture LSASS LSAsrv EFS functions Microsoft Base Cryptographic Service Provider 1.0 Cryptographic service providers... Application NTFS EFSKSecDD Encrypted file access EFS calloutsLPC User mode Kernel mode Uses impersonation to de/encrypt files in the appropriate user account

16 EFS Components Local Security Authority Subsystem LSASS (\Winnt\System32\Lsass.exe) manages logon sessions EFS obtains FEKs from LSASS KSecDD device driver implements comm. with LSASS LSAsrv listens for LPC comm. Passes requests to EFS functions Uses functions in MS CryptoAPI (CAPI) to decrypt FEK for EFS Crypto API... is implemented by Cryptographic Service Provider (CSP) DLLs Details of encryption/key protection are abstracted away Windows XP and Server 2003 have EFS support merged into NTFS driver Windows 2000 had separate EFS driver - tightly connected with NTFS

17 Format of EFS information and key entries for a file Version Checksum Number of DDF key entries DDF key entry 1 DDF key entry 2 Number of DRF key entries DRF key entry 1 Header Data decryption field Data recovery field EFS information User SID (S ) Container name (ee ba...) Provider Name (MS Base Cryptographic Provider 1.0) EFS certificate hash (cb3e4e...) Encrypted FEK (03fe4f3c...) Key entry Describes the storage position of the user‘s key Key ring (users sharing a file)

18 Encrypted Data Recovery Agents group policy Use Group Policy MMC snap-in to configure recovery agents (...list may be empty)

19 Flow of EFS Application NTFS file system driver EFS driverCache manager Volume Application writes data to an encrypted file 1 NTFS places data in file system cache 2 Cache manager lazy writes data to disk via NTFS 3 NTFS asks EFS driver to encrypt file contents headed to disk 4 NTFS writes encrypted file contents to disk 5 Note: EFS driver has been merged into NTFS on Windows XP and later

20 Encryption Process Details 1. User profile is loaded if necessary 2. A log file Efsx.log is created In system volume info dir; x is unique number In system volume info dir; x is unique number 3. Base Cryptographic Provider 1.0 generates random 128-bit FEK 4. User EFS private/public key pair is generated or obtained HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion \EFS\CurrentKeys\CertificateHash identifies the user‘s key pairs HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion \EFS\CurrentKeys\CertificateHash identifies the user‘s key pairs 5. A DDF key ring is created for the file with an entry for the user Entry contains copy of FEK encrypted with user‘s public key Entry contains copy of FEK encrypted with user‘s public key 6. A DRF key ring is created for the file Has an entry for each recovery agent on the system Has an entry for each recovery agent on the system Entries contain copies of FEK encrypted with agents‘ public keys Entries contain copies of FEK encrypted with agents‘ public keys

21 Encryption Process Details (contd.) 7. A backup file is created (Efs0.tmp) Same directory as original file Same directory as original file 8. DDF and DRF rings are added to a header EFS attributes - $LOGGED_UTILITY_STREAM EFS attributes - $LOGGED_UTILITY_STREAM 9. Backup file is marked encrypted, original file is copied to backup 10. Original file‘s contents are destroyed Backup is copied to original Backup is copied to original This results in encrypting the file contents This results in encrypting the file contents 11. The backup file is deleted 12. The log file is deleted 13. The user profile is unloaded (if it was loaded in step 1) In case of system crash, either original file or backup contain valid copy of the file content.

22 Backing Up Encrypted Files Data is never available in unencrypted form Except to applications that access file via encryption facility EFS provides a facility for backup programs: New EFS API: OpenEncryptedFileRaw(), ReadEncryptedFileRaw(), WriteEncryptedFileRaw(), CloseEncryptedFileRaw() Implemented in Advapi32.dll, use LPC to invoke function in LSAsrv LSAsrv calls EfsReadFileRaw() to obtain file‘s EFS attribute and the encrypted contents from NTFS driver Similarly, EfsWriteFileRaw() is invoked to restore file‘s contents

23 Further Reading Mark E. Russinovich and David A. Solomon, Microsoft Windows Internals, 4th Edition, Microsoft Press, Encrypting File System Security (from pp. 775) Encrypting a File for the first time (from pp. 778) The Decryption Process (from pp. 783) Applied Cryptography, B. Schneier, John Wiley & Sons, ISBN Handbook of Applied Cryptography, A.J. Menezes, CRC Press, ISBN

24 Source Code References Windows Research Kernel sources do not include NTFS A raw file system driver is included in \base\ntos\raw Also see \base\ntos\fstrl (File System Run-Time Library)