电脑里的重要文件在属性—高级里做了加密,重装系统后拒绝访问了,拜问高人如何才能恢复啊?

我之前把笔记本里的重要文件做了加密,就是右键—属性—高级—选中加密内容以便保护数据,今天电脑出现故障把系统重装了,计算机名什么的可能跟以前不一样,加密的文件都拒绝访问,拜问高人如何才能看到自己的文件啊?
谢谢大侠的解答,但是我还是不死心啊。我今天用easyrecovery 恢复出了重装系统前的 C 盘的所有内容,这样有没有可能找到以前的密钥啊,密钥存在什么路径?是在Documents and Settings 还是WINDOWS 里面啊?

前段时间,在百度HI里接到一位网友的求助,内容大致类似如下:电脑在重装系统后无法打开某文件夹了,提示没有权限。D盘是NTFS格式,该朋友在重装系统前对该文件夹加了密!又没有导出密钥来备份。总说NTFS格式的安全性比FAT32高,其中一点就体现在这个EFS加密上,基本上无法破解。
先简单介绍一下如何加密吧:右击需要加密的文件或文件夹,选[属性]——[高级]——[加密...]即可。加密后的文件夹为绿色,只有实施加密的用户才能打开,有人会说那重装系统后创建一个同名同密码的用户就行了吧,NO!涉及到很多问题:

EFS加密是通过对称算法加密的,2000支持DES,XP支持DES和3DES。但是加密所用的密钥是经过公钥算法加密的,这种算法几乎无法破解(暴力破解可以,但是不现实),而且加密的关键在于用户的SID,这个东西每次创建用户随机生成,就算用户名一致,也不行的。你的数据已经经过加密了,保存在硬盘上的就不是原来的数据了,所以不可能这么简单就访问到。2000毕竟还是C1级别的操作系统呢,如果企业的重要数据经过EFS加密,如果容易解密,后果不可想像。另外文件权限也是记录在NTFS分区的ACL(访问控制表)里的,所以只要是微软出的操作系统,都会严格检查的,ERD2003是基于Windows PE的,所以也会检查的。Windows XP也可以设置文件权限,只要选择我的文档,属性中设置为私有,就可以保证自己的了。但是更详细的设置,必须解除简单文件共享(不推荐,不安全)。
如果仅仅是权限,你重装系统后,可以用Administrators组的管理员帐号强行获取文件的控制权(先解除简单文件共享,然后在文件的属性-权限里添加你的新管理员帐号,赋予完全控制),但是加密的就无济于事了。

因此:

如果事先保存有密钥的话,那么任何用户只要安装这个密钥就可以打开加密的文件夹了。如何创建密钥呢?运行CERTMGR.MSC会打开证书管理器,找到[个人]证书下的[XXX]证书(XXX就是你的用户名),右击它选择[所有任务]——[导出]导出并保存EFS证书。当你需要时可双击导出的密钥文件,按提示安装即可。

——————————SID安全标识符介绍—————通俗地理解为操作系统的“身份证”—————

SID也就是安全标识符(Security Identifiers),是标识用户、组和计算机帐户的唯一的号码。在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SID。Windows 2000 中的内部进程将引用帐户的 SID 而不是帐户的用户或组名。如果创建帐户,再删除帐户,然后使用相同的用户名创建另一个帐户,则新帐户将不具有授权给前一个帐户的权力或权限,原因是该帐户具有不同的 SID 号。安全标识符也被称为安全 ID 或 SID。

SID的作用

用户通过验证后,登陆进程会给用户一个访问令牌,该令牌相当于用户访问系统资源的票证,当用户试图访问系统资源时,将访问令牌提供给 Windows NT,然后 Windows NT 检查用户试图访问对象上的访问控制列表。如果用户被允许访问该对象,Windows NT将会分配给用户适当的访问权限。

访问令牌是用户在通过验证的时候有登陆进程所提供的,所以改变用户的权限需要注销后重新登陆,重新获取访问令牌。

SID号码的组成

如果存在两个同样SID的用户,这两个帐户将被鉴别为同一个帐户,原理上如果帐户无限制增加的时候,会产生同样的SID,在通常的情况下SID是唯一的,他由计算机名、当前时间、当前用户态线程的CPU耗费时间的总和三个参数决定以保证它的唯一性。

一个完整的SID包括:

• 用户和组的安全描述

• 48-bit的ID authority

• 修订版本

• 可变的验证值Variable sub-authority values

例:S-1-5-21-310440588-250036847-580389505-500

我们来先分析这个重要的SID。第一项S表示该字符串是SID;第二项是SID的版本号,对于2000来说,这个就是1;然后是标志符的颁发机构(identifier authority),对于2000内的帐户,颁发机构就是NT,值是5。然后表示一系列的子颁发机构,前面几项是标志域的,最后一个标志着域内的帐户和组。

SID的获得

开始-运行-regedt32-HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Builtin\Aliases\Members,找到本地的域的代码,展开后,得到的就是本地帐号的所有SID列表。

其中很多值都是固定的,比如第一个000001F4(16进制),换算成十进制是500,说明是系统建立的内置管理员帐号administrator,000001F5换算成10进制是501,也就是GUEST帐号了,详细的参照后面的列表。

这一项默认是system可以完全控制,这也就是为什么要获得这个需要一个System的Cmd的Shell的原因了,当然如果权限足够的话你可以把你要添加的帐号添加进去。

或者使用Support Tools的Reg工具:

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

还有一种方法可以获得SID和用户名称的对应关系:

1. Regedt32:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion \ProfileList

2. 这个时候可以在左侧的窗口看到SID的值,可以在右侧的窗口中ProfileImagePath看到不同的SID关联的用户名,

比如%SystemDrive%\Documents and Settings\Administrator.momo这个对应的就是本地机器的管理员SID

%SystemDrive%\Documents and Settings\Administrator.domain这个就是对应域的管理员的帐户

另外微软的ResourceKit里面也提供了工具getsid,sysinternals的工具包里面也有Psgetsid,其实感觉原理都是读取注册表的值罢了,就是省了一些事情。

SID重复问题的产生

安装NT/2000系统的时候,产生了一个唯一的SID,但是当你使用类似Ghost的软件克隆机器的时候,就会产生不同的机器使用一个SID的问题。产生了很严重的安全问题。

同样,如果是重复的SID对于对等网来说也会产生很多安全方面的问题。在对等网中帐号的基础是SID加上一个相关的标识符(RID),如果所有的工作站都拥有一样的SID,每个工作站上产生的第一个帐号都是一样的,这样就对用户本身的文件夹和文件的安全产生了隐患。

这个时候某个人在自己的NTFS分区建立了共享,并且设置了自己可以访问,但是实际上另外一台机器的SID号码和这个一样的用户此时也是可以访问这个共享的。

SID重复问题的解决

下面的几个试验带有高危险性,慎用,我已经付出了惨痛的代价!

微软在ResourceKit里面提供了一个工具,叫做SYSPREP,这个可以用在克隆一台工作站以前产生一个新的SID号码。 下图是他的参数

这个工具在DC上是不能运行这个命令的,否则会提示

但是这个工具并不是把所有的帐户完全的产生新的SID,而是针对两个主要的帐户Administrator和Guest,其他的帐号仍然使用原有的SID。

下面做一个试验,先获得目前帐号的SID: S-1-5-21-2000478354-688789844-839522115

然后运行Sysprep,出现提示窗口:

确定以后需要重启,然后安装程序需要重新设置计算机名称、管理员口令等,但是登陆的时候还是需要输入原帐号的口令。

进入2000以后,再次查询SID,得到:

S-1-5-21-759461550-145307086-515799519,发现SID号已经得到了改变,查询注册表,发现注册表已经全部修改了,当然全部修改了。

另外sysinternals公司也提供了类似的工具NTSID,这个到后来才发现是针对NT4的产品,界面如下:

他可不会提示什么再DC上不能用,接受了就开始,结果导致我的一台DC崩溃,重启后提示“安全账号管理器初始化失败,提供给识别代号颁发机构的值为无效值,错误状态0XC0000084,请按确定,重启到目录服务还原模式...”,即使切换到目录服务还原模式也再也进不去了!

想想自己胆子也够大的啊,好在是一台额外DC,但是自己用的机器,导致重装系统半天,重装软件N天,所以再次提醒大家,做以上试验的时候一定要慎重,最好在一台无关紧要的机器上试验,否则出现问题我不负责哦。另外在Ghost的新版企业版本中的控制台已经加入了修改SID的功能,自己还没有尝试,有兴趣的朋友可以自己试验一下,不过从原理上应该都是一样的。

文章发表之前,又发现了微软自己提供的一个工具“Riprep”,这个工具主要用做在远程安装的过程中,想要同时安装上应用程序。管理员安装了一个标准的公司桌面操作系统,并配置好应用软件和一些桌面设置之后,可以使用Riprep从这个标准的公司桌面系统制作一个Image文件。这个Image文件既包括了客户化的应用软件,又把每个桌面系统必须独占的安全ID、计算机账号等删除了。管理员可以它放到远程安装服务器上,供客户端远程启动进行安装时选用。但是要注意的是这个工具只能在单硬盘、单分区而且是Professional的机器上面用。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-08-29
我来点实际的。
密钥不可能找到的。重装系统后用easyrecovery的是RAW回复吧?所有的文件的文件名都是随机匹配的。
我是业内人士,我到目前还没看到重装系统之后还可以找到密钥的。也许早就覆盖掉了,就算没覆盖,没有原来的分区表,没有原来的文件名。也找不到啊。
第2个回答  2009-08-30
Troubleshoot a problem with your computer's hard disk
This problem was caused by Windows not being able to open a file on your computer's hard disk. This might be a temporary condition that could go away after restarting your computer, or it could be a more serious problem with your hard disk or its driver.

To troubleshoot this problem, follow these steps:

Restart your computer

When you restart your computer, Windows will automatically check your disk for errors, and will try to recover any files that are located on damaged areas on the disk.

If the problem persists after you restart you computer, try the next step.

Run the hard disk error-checking tool

You can help solve some computer problems and improve the performance of your computer by checking your hard disk for errors. Follow these steps to run the hard disk error-checking tool:

Click the Start button , and then click Computer.

Right-click the hard disk drive that you want to check, and then click Properties.

Click the Tools tab, and then, under Error-checking, click Check Now. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

Select Automatically fix file system errors and Scan for and attempt recovery of bad sectors.

Click Start.

When prompted to schedule the disk check to occur after a restart, click Schedule disk check.

Restart your computer.

Note: Depending upon the size of your hard disk, the disk check might take several minutes.

After your computer restarts and the error check has run, review the summary report for any bad sectors or files that were repaired.

If the report cites any bad sectors that cannot be repaired, this usually means there is a problem with the hard disk itself. If this is the case, you should back up your data immediately and install a new hard disk. Read the Windows Help article Methods for backing up your files for more information about backing up your hard disk.

If there were no reported problems and you continue to see the same error, then your computer might have a problem with its file system. See the next step for some suggestions.

What you can do if the problem is being caused by the Windows file system

If you've followed the steps above and suspect there is a problem with the computer's file system, there are a few things you can try:

Contact your computer manufacturer for support.

How do I find my computer manufacturer?

Click the Start button , type msinfo32 in the Search box, and then press ENTER. Your computer manufacturer is listed as the System Manufacturer in the right pane of the System Information window.

Click to go online to see contact information for most computer manufacturers
Bring your computer to a professional repair shop.

Read the Windows Help article What to do if Windows won't start correctly, which includes additional troubleshooting steps.
Additional information

Advanced troubleshooting

Warning
This section is intended for advanced computer users, such as software developers and network administrators. If you are not comfortable with advanced troubleshooting procedures, we recommend you consult someone who is before going further.

Find the file that is causing the error and then try to open it

Click the Start button .

In the Search box, type EVENTVWR, and then press ENTER. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

In Event Viewer, double-click Windows Logs, and then click Application.

Click the Source column heading to list all the Application Error sources at the top of the list.

Search for an event with a source of Application Error and an event ID of 1005.

Double-click this event.

The file that cannot be opened will be listed in the section at the top. Write down the file name, and then close Event Properties.

Click the Start button , and then, in the Search box type the file name. Once your computer finds the file, try to open it by clicking the name of the file in the search results. The problem might have been temporary and might not occur when the program runs again. If you are unable to open the file, go to the next step.

Reinstall the Windows operating system

If you determine there is a problem with the Windows file system that cannot be corrected with the disk error-checking tool, and the earlier procedure was unsuccessful, you might have to reinstall the operating system.

To learn how to reinstall Windows Vista, go online to the following KB article:

Installing and reinstalling Windows
What is a hard disk?

The primary storage device located inside a computer. Also called a hard drive or hard disk drive, it is where your files and programs are typically stored.

What are drivers?

A device driver is software that enables hardware or devices (such as a printer, mouse, or keyboard) to work with your computer. Every device needs a driver in order for it to work.

--------------------------------------------------------------------------------
相似回答