如何以编程方式在linux / windows中实现对特定文件类型的密码访问? [英] How to implement password access to specific file type in linux/windows programmatically?

查看:60
本文介绍了如何以编程方式在linux / windows中实现对特定文件类型的密码访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux and Windows question.

1. I do not want user to launch all ".doc" files (including those he brings in).
2. User tries to launch a file "test.doc". 
3. The password window appears. 
4. If the password is correct, the file is opened. 
Know how?..





我尝试过:





What I have tried:

I read this guide: 

http://www.wikihow.com/Create-a-Password-Protected-File-on-Windows-7

The problem is that I want to do it by mask, not just a few known files.

推荐答案

你没有。



Windows不支持在没有重写内核块的情况下做这样的事情,或者至少拦截I / O具有库的函数,例如Detours(
You don't.

Windows doesn't support doing such a thing without rewriting a chunk of the kernel, or at least intercepting I/O functions with a library, such as Detours (


10,000)。



另外,您如何确定用户的内容实际上在做什么?读取文件以打开文件和读取文件进行复制完全没有区别。由于文件也可以随时打开文件以供读取,例如当没有人登录控制台并且病毒扫描程序正在执行此操作时,如何由不存在的用户输入密码?



我不知道Linux的具体细节,但我认为同样的限制适用于适用于所有现代操作系统的概念。



你不是第一个提出这个想法的人,你不会是最后一个。这表明你不了解Windows内置的安全模型及其工作原理。



你所描述的与你写的内容无关你发布的链接。
10,000).

Also, how are you going to determine what the user is actually doing? There is absolutely no difference between reading a file to open it and reading a file to copy it. Since a file can also be opened file for read at any time, like when nobody is logged into the console and a virus scanner is doing its thing, how is a password going to be entered by a non-existent user?

I don't know the specifics of Linux but I would imagine the same limitations apply since these are concepts that apply to all modern operating systems.

You're not the first noob to come up with this idea and you won't be the last. What this shows is that you don't understand the security model built into Windows and how it works.

What you described has nothing to do with what was written in the link you posted.


这篇关于如何以编程方式在linux / windows中实现对特定文件类型的密码访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆