خوب با تشکر بی کران از سپاس های فراون شما و از اینکه ماشا ا.. همه به سوالاتی که گذاشته بودیم جواب دادند بحث رو ادامه بدیم. 
خوب ! ببینیم چه کسی می تواند فایل ها را رمزگذاری یا Encrypt کند ؟
به صورت کلی میتوان گفت Administrators، مالک فایل و در کل کسی که سه مجوز زیر را نسبت به فایل داشته باشد می تواند آن را Encrypt کند :
List Folders, Read Data
Create Files, Write Data
Write Attributes
خوب ! چه کسی می تواند آن را رمزگشایی یا Decrypt کند ؟
پاسخ : فقط کسی که آن را Encrypt کرده است
نکته اول : اگر یوزری فایل را Encrypt کرد و بعد آن را پاک کردیم، حتی اگر با مشخصات قبلی اش باز هم آن را بسازیم نمیتواند Decrypt کند. باید از قبل Recovery Agent درست کرده باشیم یا شاید برنامه های 3rd Party کمک کنند.
نکته دوم : اگر کاربر رمزش را فراموش کند و آن را Reset Password کنیم باز هم نمیتواند به فایلهای رمز شده اش دسترسی داشته باشد مگر آن که رمز دقیقا همان رمز قبلی ست شود. البته اگر خودش Change Password کند مشکلی نیست.
نکته سوم : مالک (Owner) فایل را عوض کرده ایم. مالک جدید می تواند Decrypt کند ؟ پاسخ : خیر
نکته چهارم : در ویندوز 2000 و ایکس پی (بقیه را شما تحقیق کنید) نمیتوان فایل را هم Compress و هم Encrypt کرد.
نکته پنجم : فایلهای Encrypted در ویندوز ایکس پی با رنگ سبز و فایلهای Compressed با رنگ آبی نشان داده می شودند. برای غیر فعال کردن این قضیه می توانید از Folder Option تیک گزینه زیر را بردارید.
Show Encrypted and Compressed NTFS Files in Color
نکته ششم را داشته باشید : اگر فولدری Encrypt بشود، هر فایلی داخل آن کپی یا ذخیره کنیم خود به خود رمز گذاری می شود. ضمنا اگر یک فایل Encrypted را copy یا move کنیم در همان حالت رمز شده باقی می ماند.
نکته هفتم را هم ببینیم که جالب است. فایل رمز شده را اگر بخواهید روی فلاپی یا درایوی با FAT32 کپی کنید به این خیال که خوب دیگر NTFS نیست و می توان آن را باز کرد شرمنده. البته خود کسی که فایل را رمز کرده می تواند این کپی را انجام بدهد و طبیعی است که بعد از آن خاصیت Encrypt از بین می رود.
خوب ! کمی هم فشرده سازی یا Compress را بررسی کنیم.
چه کسی می تواند فایل را Compress کند ؟
کسی که نسبت به آن مجوز write داشته باشد.
نکته اول : مثل حالت رمز گذاری، اگر شاخه ای Compress باشد، فایلهای ذخیره شده یا کپی شده به داخل آن هم Compress می شوند.
نکته دوم : اگر فایل Compress شده را Cut کنیم، Compress باقی می ماند اما اگر آن را کپی کنیم، شرایط مقصد تعیین کننده وضعیت آن خواهد بود.
نکته سوم : فشرده شدن فایلها در ویندوز Transparent است. یعنی همانطور که فشرده شده اند آنها را می بینید و با آنها کار می کنید نه مثل فایلهای Zip که باید اول باز شوند بعد استفاده گردند.
نکته چهارم : یادتان باشد ویندوز در فشرده کردن فایلهای گرافیکی مانند PNG,JPG,GIF بسیار ضعیف عمل می کند. (این فایلها کلا زیاد فشرده نمی شوند) و برای فشرده سازی آنها باید از برنامه های مخصوص مانند فوتوشاپ استفاده شود.
نکته پنجم : نکن برادر من نکن ! فایلهای اجرایی خصوصا آنهایی که زیاد باید اجرا شوند را فشرده نکن که کندی محسوسی را تجربه خواهی کرد.
دستوری در خط فرمان :
دستور Cipher به شکل خط فرمانی می تواند فایلها را Encrypt یا Decrypt کند. این دستور پیش فرض روی فولدر کار می کند و برای فایلها باید از سوییچ /a استفاده کنید. البته فایلهای فقط خواندنی را نمیتوان با این دستور Encrypt کرد
سوییچ E فایل را Encrypt و سوییچ D هم Decrypt می کند.
مثال : فایل 1.txt را می خواهیم رمزگذاری کنیم.
Cipher /a /e c:\1.txt
کل پارامترهای دستور را اینجا می بینید. البته لینک زیر هم باحال است :
Cipher
Displays or alters the encryption of folders and files on NTFS volumes. Used without parameters, cipher displays the encryption state of the current folder and any files it contains.
Syntax
Parameters
/e : Encrypts the specified folders. Folders are marked so that files that are added to the folder later are encrypted too.
/d : Decrypts the specified folders. Folders are marked so that files that are added to the folder later are encrypted too.
/s: dir : Performs the selected operation in the specified folder and all subfolders.
/a : Performs the operation for files and directories.
/i : Continues performing the specified operation even after errors occur. By default,
cipher stops when it encounters an error.
/f : Forces the encryption or decryption of all specified objects. By default,
cipher skips files that have been encrypted or decrypted already.
/q : Reports only the most essential information.
/h : Displays files with hidden or system attributes. By default, these files are not encrypted or decrypted.
/k : Creates a new file encryption key for the user running
cipher. If you use this option,
cipher ignores all of the other options.
/u : Updates the user's file encryption key or recovery agent's key to the current ones in all of the encrypted files on local drives (that is, if the keys have been changed). This option only works with
/n.
/n : Prevents keys from being updated. Use this option to find all of the encrypted files on the local drives. This option only works with
/u.
PathName : Specifies a pattern, file, or folder.
/r:PathNameWithoutExtension : Generates a new recovery agent certificate and private key, and then writes them to files with the file name specified in
PathNameWithoutExtension. If you use this option,
cipher ignores all of the other options.
/w:PathName : Removes data on unused portions of a volume.
PathName can indicate any directory on the desired volume. If you use this option,
cipher ignores all of the other options.
/? : Displays help at the command prompt.
[IMG]file:///J:/DOCUME%7E1/MR2/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image001.gif[/IMG]Top of page
Remarks
•
Using /w
/w removes data from portions of the volume it can access and have not been allocated to files or directories. It does not lock the drive, so other programs can obtain space on the drive, which cipher cannot erase. Because this option writes to a large portion of the hard volume, it might take a long time to complete and should only be used when necessary.
•
Encrypting or decrypting files
To prevent an encrypted file from becoming decrypted when it is modified, it is recommended that you encrypt both the file and the folder in which it resides.
•
Using read-only files and folders
Cipher cannot encrypt files that are marked as read-only.
•
Using multiple folder names
You can use multiple folder names and wildcard characters.
•
Using multiple parameters
You must separate multiple parameters by at least one space.
Examples
To use cipher to encrypt a subfolder named May in a folder named MonthlyReports, type:
cipher /e monthlyreports\may
To encrypt the MonthlyReports folder, the January through December subfolders, and the Manufacturing subfolders within the month subfolders, type:
cipher /e /s:monthlyreports
To encrypt only the Marketing.xls file in the May subfolder, type:
cipher /e /a monthlyreports\may\marketing.xls
To encrypt the Marketing.xls file, the Maintenance.doc file, and the Manufacturing subfolder (located in the May folder), type:
cipher /e /a monthlyreports\may\ma*
To determine whether the May folder is encrypted, type:
cipher monthlyreports\may
To determine which files in the May folder are encrypted, type:
cipher monthlyreports\may\*
میدونم جلسه کوتاهی شد اما اجازه بدید بحث همینجا بمونه تا جلسه بعد به سراغ Remote Desktop بریم و بحثها قاطی نشن. باز هم از دوستان خواهش میکنم نکات تکمیلی رو اضافه بفرمایند و احیانا اگر سوالی هست هم در خدمتیم.
*****
آهان ! اجازه بدید یک مطلب مهم دیگر رو هم اضافه کنیم یعنی ساختن یوزری که بتواند در صورت لزوم فایلهای بقیه را رمزگشایی کند که اصطلاحا آن را با نام Data Recovery Agent یا DRA می شناسیم.
در ویندوز 2000، کاربر Administrator به صورت پیش فرض این قدرت را داشت اما در XP Pro این گونه نیست و اگر چنین قابلیتی میخواهید، باید آن را دستی ایجاد کنید. ضمنا به یاد داشته باشید فعلا داریم در مورد Workgroup حرف می زنیم نه Domain
برای دادن این قابلیت به یک کاربر به طریق زیر عمل می کنیم.
1- با یوزر مربوطه مثلا Amin دستور Cipher /r:test را اجرا کنید. با این دستور رمزی از شما پرسیده شده (برای محافظت) و دو فایل با پسوندهای cer و pfx ایجاد می شوند.
2- مراحل زیر را انجام داده و فایل cer مربوطه را معرفی کنید.
3- To create a local recovery agent
a. Click Start, click Run, type mmc, and then click OK.
b. On the File menu, click Add/Remove Snap-in, and then click Add.
c. Under Add Standalone Snap-in, click Group Policy Object Editor, and then click Add.
d. Under Group Policy Object, make sure that Local Computer is displayed, and then click Finish.
e. Click Close, and then click OK.
f. In Local Computer Policy, navigate to the Local\Computer Policy\Computer Configuration\Windows Settings\Security Settings\Public Key Policies folder.
[IMG]file:///J:/DOCUME%7E1/MR2/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image001.jpg[/IMG]
g. In the details pane, right-click Encrypting File System, and then click Add Data Recovery Agent or Create Data Recovery Agent.
Note: The Wizard prompts you for a user name for a recovery agent. You can supply the wizard with the name of a user with a published file recovery certificate, or you can browse for file recovery certificates (.cer files) that contain information about the recovery agent you want to add. File recovery certificates can be obtained from Certification Authorities. To identify a file recovery certificate, in the Certificates snap-in, in the details pane, in the Enhanced Key Usage field, look for the value File Recovery (1.3.6.1.4.1.311.10.3.4.1). File recovery certificates are stored as .cer files in the local computer file system or in Active Directory.
When you add a recovery agent from a file, the user is identified as USER_UNKNOWN because the user name is not stored in the file.
h. Follow the instructions in the wizard to complete the process.
خلاصه دو مرحله بالا این چند خط است. بعید میدانم نیازی به ترجمه باشد :
Step 1: Export recovery certificates and the private key
- Log on to the computer as the user who you want to create the encrypting file for.
- Click Start, click Run, type CMD, and then click OK.
- At the command prompt, type the following, and then press ENTER:
cipher /r:filename
- Type the password that you want to use when you receive the following message:
Please type in the password to protect your .PFX file:
The system creates a .PFX file that contains the certificate and the private key and a .CER file that contains only the certificate. You receive the following verification message:
Your .CER file was created successfully.
Your .PFX file was created successfully.
[IMG]file:///J:/DOCUME%7E1/MR2/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image002.gif[/IMG]Back to the top
Step 2: Import recovery certificates and the private key
- Log on to the computer as the administrator.
- Click Start, click Run, type gpedit.msc, and then click OK.
- In the Group Policy Object Editor, expand the following nodes:
Local Computer Policy
Computer Configuration
Windows Setting
Security Settings
Public Key Policies
- Right-click Encrypting File System, and then click Add Data Recovery Agent.
- Click Next, and then click Browse Folders.
- Select the *.CER file that you created earlier, and then click Open.
Note By default, the certificate is created in the %userprofile% folder. - Click Next, and then click Finish.
این لینک هم اطلاعات بسیار خوبی در خصوص Protection در windows XP دارد