文件加密标识 -OSR经典对白

2024-02-07 03:48
文章标签 加密 标识 osr 经典对白

本文主要是介绍文件加密标识 -OSR经典对白,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文件加密标识 -OSR经典对白
<script language="JavaScript" src="http://ads.zndev.com/adx.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> </script> <script language="JavaScript" src="http://ads.zndev.com/adjs.php?n=174997347&what=zone:4&exclude=,&referer=http%3A//www.baidu.com/baidu%3Fword%3DOSR%25BE%25AD%25B5%25E4%25B6%25D4%25B0%25D7%26tn%3Dmyie2dg" type="text/javascript"></script>

第一篇
FS Filter Driver question
________________________________________
Dear NTDev folks,

We are writing a FileSystem Filter Driver, that mangles the contents of
a particular file, such that:
1) the content is Mangled on Write, and
2) Unmangled on Read.

Our Mangling actually increases the size of the file, and we also insert
our own header data in the beginning of the file.

However we still want to present the "correct" file-length to the client
programs (e.g. they shouldn't know that the data is actually mangled
before it's stored in the file).

We have been able to do this, to some degree, by handling the Read/Write
IRPs, and modifying the length fields in the QueryInformation IRPs (for
both File Information, and Directory Listings).

However, we are worried that interactions between the underlying
FileSystem Driver, and the Cache Manager may expose the real length of
the file in some cases (e.g. through the FileSize field in the
FSRTL_FCB_COMMON_HEADER structure stored in the FsContext field of the
FileObject), or cause other problems.  We are not able to find a good
discussion on Data Modifying filter drivers in the IFS kit documentation
or in the "Windows NT File System Internals" Book by Rajeev Nagar.

FileSystem Filter Drivers that do non-length-preserving Encryption or
Compression must face the same issues that we are coming across.  We
would really appreciate it if you folks could shed some light on how the
cache manager may affect FileSystem Filter Drivers that mangle the
content of the file such that the actual file length changes, or if you
could suggest some resources where this information is available.

Re: FS Filter Driver question
________________________________________
Why put the "header" at the beginning?  It is the most difficult place to put it
and maintain any semblance of obfuscation.  Put it at the end and give yourself
enough space to permit expanding it easily.  I would recommend that the last
128, 256, 512, etc bytes be the "header/trailer".  If expansion becomes required
later, you can expand downwards from that fixed part of the header that will let
you know the file is yours.

The following are questions you need to answer before you design your solution:

1.    Can the file be accessed in "mangled" form by any program, at any time? 
Backup?
2.    Can the file be modified by any of the Microsoft Office programs?
3.    Why do you care if one program "knows" the file size if wrong?  What can
be revealed?



Re: FS Filter Driver question
________________________________________
I don't see any problem with FCB's FileSize having bigger value than what
you report through other interfaces.
However, I must agreed with David that having header at the beginning of
the file is not the best solution. The only significant advantage
I can see is that you simplify handling of file expansion (only
considering that header has fixed size). However you gain a lot of
complications
trying to keep the header out of the cache, dealing with
FileObject->CurrentByteOffset for sequential files (these are just from
the top of my head).
So, unless there are particular reasons why you want to have your header
at the beginning of the file, I would suggest to put it at the end or even
strip it completely from the file and keep it somewhere else.

Regards,

Vladimir



Re: FS Filter Driver question
If you're on NTFS you could consider keeping it in an alternate stream in the file.


Re: FS Filter Driver question
________________________________________
Hi David, Vlad, Peter,

Thanks so much for your helpful suggestions.

- We keep the fixed-size header data in the file for our own informational
purpose, and this header is not necessarily related to the content-mangling
algorithm (with which we mangle the actual contents of the file).

- Even if we don't keep the header in the beginning of the file, doesn't the
problem of trying to hide it from the Cache Manager still exist?
(we currently do adjust the FileObject->CurrentByteOffset for certain IRPs to
skip the header, and we keep the header in the beginning for only the reasons
that Vlad mentioned).

- Also, let's assume that we keep no header in the file, our mangling algorithm
still increases the length of the file (similar to an encryption algorithm), if
the Cache Manager is able to read the "increased size" of the file, but then it
is not able to get all the data (because we are un-mangling and giving it the
actual data (which is smaller in size)), will that cause problems?

- The files we mangle can be binaries or data files, e.g. MS Office Programs can
certainly use them as documents, or DLLs. (if our driver is loaded, these files
will be read correctly, if our driver is not loaded, then the file will be seen
as containing garbage data).

- Lastly, we need to be agnostic of File System types (i.e. we can't rely on
NTFS features, which would have been nice :-) ).


Re: FS Filter Driver question (Tony Mason - DDK MVP)
________________________________________
The only way I've seen this work is to construct a filter that works much
like the compression support for NTFS - that is, your "filter" integrates
into the cache manager and then creates different file objects which it
sends to the underlying FSD.  The version YOU maintain in the cache has the
right length/size information, which is what will be used by application
programs.

Then your "filter" calls the underlying FSD to obtain the data (in mangled +
offset) form.  That the file size underneath you is different doesn't
matter.

Of course, when you are done what you have is more like a stacked file
system than a filter - these are the most complex filters that I've seen,
and I think are harder to develop than a file system.

Re: FS Filter Driver question
________________________________________
Ways to keep the header out of the cache are conceptually different for those two cases. In case if header is at the end you may not even care if it gets into the cache (unless you don't want to expose its content). And event if you don't want anybody to see what is in it, you can simply get its valid content in the read completion routine and then fill the buffer with some garbage. But if you have the header at the beginning you can't afford it to get cached at all because in this case you will end up screwing actual file content when file gets memory mapped. I’m not saying it is impossible. I just think that avoiding this problem will give you more headaches than supporting file expansion with the header at the end.


Re: FS Filter Driver question
________________________________________
Tony: Isn’t “shrinking” bigger file into cache significantly different than expanding smaller file? Since in this case CM will allocate enough pages to fit actual file content? And what does it mean “filter" integrates into the cache manager”? Do you mean that filter will initialize (and whole 9 yards) FO that it receives in the create dispatch and use actual FS just to read/write mangled file? Or there is something else?



                                    第二篇




On Fly encryption filter driver

I am developing a file system filter driver on windows 2000, which does on fly encryption and decryption. I would like to know what is best method to mark the file for encryption. My plan is to add a header information to the encrypted file so that the filter driver will use this information to identify the encrypted file when it is read or written to the disk. Does this solution have any side-effects ? One more issue I have identifed is with temporary files that are created by applications like MS-Word, Visual studio. For example, if an encrypted word document is opened with MS-Word, it creates a temporary document with the same contents and when the document is saved it deletes the original document and renames the temporary document to the orignal name. Since the temoprary document is not marked for encryption its contents will NOT be in encrypted format and when it is renamed to orginal document it is still unencrypted. But the user thinks that the original document is encrypted and hence it is a bug. Is there any solution for this ?


Re: On Fly encryption filter driver
________________________________________
> I am developing a file system filter driver on windows 2000, which does on
> fly encryption and decryption. I would like to know what is best method to
> mark the file for encryption.

Sideband data in the registry, INI file or such.

> My plan is to add a header information to the encrypted file so that the

This will require major effort in dealing with 2 concepts of file sizes.

The encryption filter which adds a header or changes the file size if not a
filter, but more like a complete FSD (which its own FCBs, own file sizes and
Cc/Mm interaction) built on top of another FSD.

For a simple filter, avoid changing the file size and avoid adding headers.

 

这篇关于文件加密标识 -OSR经典对白的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/686432

相关文章

Java中的密码加密方式

《Java中的密码加密方式》文章介绍了Java中使用MD5算法对密码进行加密的方法,以及如何通过加盐和多重加密来提高密码的安全性,MD5是一种不可逆的哈希算法,适合用于存储密码,因为其输出的摘要长度固... 目录Java的密码加密方式密码加密一般的应用方式是总结Java的密码加密方式密码加密【这里采用的

使用Python制作一个PDF批量加密工具

《使用Python制作一个PDF批量加密工具》PDF批量加密‌是一种保护PDF文件安全性的方法,通过为多个PDF文件设置相同的密码,防止未经授权的用户访问这些文件,下面我们来看看如何使用Python制... 目录1.简介2.运行效果3.相关源码1.简介一个python写的PDF批量加密工具。PDF批量加密

3.比 HTTP 更安全的 HTTPS(工作原理理解、非对称加密理解、证书理解)

所谓的协议 协议只是一种规则,你不按规则来就无法和目标方进行你的工作 协议说白了只是人定的规则,任何人都可以定协议 我们不需要太了解细节,这些制定和完善协议的人去做的,我们只需要知道协议的一个大概 HTTPS 协议 1、概述 HTTPS(Hypertext Transfer Protocol Secure)是一种安全的超文本传输协议,主要用于在客户端和服务器之间安全地传输数据

ja-netfilter的前世今生和非对称加密的欺骗原理

文章目录 ja-netfilter起源官网插件插件配置文件插件的综合应用更多用法 非对称加密欺骗原理非对称加密和数字证书激活过程和欺骗手段分析代码示例第一步:生成自签名证书脚本第二步:使用自签名证书对产品激活信息进行签名 样例数据样例激活码(注:用于代码演示,直接粘贴到JetBrains 家 IDE 中无法完成激活!不用试,肯定提示无效,无法激活!!)样例power.conf(配合ja-ne

Linux加密框架设计与实现

本文转自网络文章,内容均为非盈利,版权归原作者所有。 转载此文章仅为个人收藏,分享知识,如有侵权,马上删除。 原文作者:原文作者是独孤九贱大佬 原文地址:http://bbs.chinaunix.net/thread-3627341-1-1.html

Android的登陆MD5加密

1:导入代码 public class MD5Util {private static final String TAG = "MD5Util";/**** MD5加码 生成32位md5码*/public static String string2MD5(String inStr) {Log.e(TAG, "string2MD5: -------------------------");Mess

超级 密码加密 解密 源码,支持表情,符号,数字,字母,加密

超级 密码加密 解密 源码,支持表情,符号,数字,字母,加密 可以将表情,动物,水果,表情,手势,猫语,兽语,狗语,爱语,符号,数字,字母,加密和解密 可以将文字、字母、数字、代码、标点符号等内容转换成新的文字形式,通过简单的文字以不同的排列顺序来表达不同的内容 源码截图: https://www.httple.net/152649.html

如何实现加密功能

文章目录 1. 概念介绍2. 方法与功能2.1 基本用法2.2 加密算法 3. 示例代码4. 内容总结 我们在上一章回中介绍了"FlutterCacheManager组件"相关的内容,本章回中将介绍一个加密工具包.闲话休提,让我们一起Talk Flutter吧。 1. 概念介绍 加密主要是为了保护一些重要数据,我们在实际项目中会用到加密工具,因此在本章回中介绍一个加密工具

详解BitLocker模式及加密数据和解密方法及无法访问解决之道

BitLocker主要有两种工作模式:TPM模式和U盘模式,同时为了实现更高程度的安全,我们还可以同时启用这两种模式。 BitLocker 自动设备加密在全新安装体验 (OOBE) 期间启动。 但是,只有在用户使用 Microsoft 帐户或 Azure Active Directory 帐户登录后,才会启用(提供)保护。 在此之前,保护已暂停,数据不受保护。 使用本地帐户不会启用 BitLoc

加密方式的判断---神器 hash_identifier

加密作为保障数据安全的一种方式,它不是现在才有的,它产生的历史相当久远,它是起源于要追溯于公元前2000年(几个世纪了),虽然它不是现在我们所讲的加密技术(甚至不叫加密),但作为一种加密的概念,确实早在几个世纪前就诞生了。当时埃及人是最先使用特别的象形文字作为信息编码的,随着时间推移,巴比伦、美索不达米亚和希腊文明都开始使用一些方法来保护他们的书面信息。 加密在网络上的作用就是防止有用或私有