Encryption/decryption system for USB storage devic

SiLan_EAP_AOI_Test_Case.xlsx 立即下载
 Author : Rajesh Nath


Introduction
Plug-n-Play USB mass storage devices have become one of the biggest Information Security threats. USB Mass Storage Devices (MSD’s) can be used to carry out data in huge volumes that can prove vital for an organization’s data secrecy policy. USB Drives are small, cheap, easily available, easy-to-use and can carry huge data and thus can be used to take complete copies of original software or can prove threat to confidential documents.

Background
IT and ITES Organizations dealing with huge amounts of business-related sensitive data must take into account all proactive measures to defend inadvertent data leakage or deliberate data theft by employing end-point security solutions. We have poking around for sometime now, to look for concrete ways, to defend data leakage using USB thumb drives. We are presenting below a methodology to prevent the same in a Windows Domain based networked infrastructure of an organization.

The CORE Idea
The core idea is to secure data that is or can be sensitive for an organization. But alas! We can’t mark (or watermark) files that are sensitive and insensitive, since that would require a much more elaborate application with complete File System auditing capabilities. In turn we were looking for a simpler approach that can provide definite security. The idea we conceptualized, is to encrypt all the contents which is written from machine to a USB MSD and decrypt in vice-versa communication for a particular domain. This encryption/decryption is performed on the fly without any user intervention. One of the possible methodologies to achieve this task is to use a combination of User Mode NT Service and a Kernel Mode Filter Driver. We are presenting the core concept below with some pseudo code. Detailed implementation can be found in the attached source files. The main components of the project are:- 1) USB Controller NT Service: - This is a NT Service written in C++ with Win32 APIs. It is used for detecting the insertion of USB MSD into the machine. Furthermore, this service performs the functionality of checking whether valid domain user is logged into the machine or not. If yes, then only decryption of data is performed, otherwise not. 2) File System Filter Driver (FSFD):- This File system driver module handles the encryption and decryption of data read/write from/to USB MSD. The process of encryption and decryption is performed on the fly

Basic Control Flow
The basic control flow is explained in the below mentioned steps:- 1. Kernel mode FSFD is loaded at the time system boots up. 2. User Mode NT Service (nick named USB Controller) also gets started at the time of system start up. 3. Our service waits for any user to insert USB MSD into the machine. The FSFD waits for IOCTL’s from our NT Service so that it can perform desired operation (encryption/decryption). 4. As soon as an user inserts a USB MSD into the machine, USB Controller service detects the same and checks whether the user is a valid domain user or not. 5. If the user is a valid domain user, then USB Controller signals the FSFD to carry on with encryption/decryption of data that is written/read from the USB Drive. 6. If the user is not a valid domain user, then data written to the USB Drive is encrypted, but the data read from the drive is not decrypted and hence the data becomes obsolete for the user. NOTE: - The functionality achieved with this solution is that domain specific data would be available in a meaningful format for valid domain users. Invalid domain users would see the data as junk … since it would be encrypted for them. A strong encryption algorithm would mean stronger security which would be nearly impossible to break.

USBController NT Service
Why in a first place would a service be required? If someone asks me this question, then I would suggest that go …. get your Windows Basics correct first…. and then read this article. Well, Yes! An NT Service is an obvious choice for all security software since NT Services are the most reliable user more applications of Windows NT/2K/XP/Vista which provides more flexible start up options with running under admin privileges. USB Controller Service that I am presenting below runs under the SYSTEM account (which is the most privileged account under NT). This service is made Auto-start so that Windows starts this service at the time of Boot-up. Inside service_main function, we register for device notification using the RegisterDeviceNotification API. I have provided the Device Class GUID of USB Mass Storage Devices in the NotificationFilter.dbcc_classguid parameter so that I receive notifications of the devices that belong to this device class.


    NotificationFilter.dbcc_size        = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    NotificationFilter.dbcc_devicetype   = DBT_DEVTYP_DEVICEINTERFACE;
    NotificationFilter.dbcc_classguid    = GUID_DEVINTERFACE_USBSTOR;
     //NotificationFilter.dbcc_classguid    = GUID_DEVINTERFACE_CDROM;

    HDEVNOTIFY hDevNotify = RegisterDeviceNotification( sshStatusHandle,
                                   &NotificationFilter,
                                   DEVICE_NOTIFY_SERVICE_HANDLE);


For more details of RegisterDeviceNotification, go through the API documentation on MSDN. (http://msdn2.microsoft.com/en-us/library/aa363431.aspx) Whenever Windows detects any USB MSD insertion, it calls the HandlerEx function of our service with SERVICE_CONTROL_DEVICEEVENT event. In our case the HandlerEx function is service_ctrl(). Also, Windows supplies the type of Event received (DBT_DEVICEARRIVAL or DBT_DEVICEREMOVECOMPLETE or other) with a pointer to a buffer which contains the device specific information. As soon as a Device Arrival Event is received, we enumerate the logged-in users and check whether they are valid domain users. This functionality is achieved by the help of LsaEnumerateLogonSessions and LsaGetLogonSessionData APIs. LsaEnumerateLogonSessions enumerates the Logon sessions that are currently active on that machine. In addition to the active directory user logon session, this API also provides the information of local machine authentication information for NT AUTHORITY domain and NTLM domain. Here, the catch is to use the information pertaining to our need only and discard the rest.
     PLUID sessions;
     ULONG count;
     retVal = LsaEnumerateLogonSessions(&count,&sessions);


For more information on LsaEnumerateLogonSessions, refer to its MSDN documentation (http://msdn2.microsoft.com/en-us/library/aa378275.aspx). LsaGetLogonSessionData gets the information for each of the logon sessions enumerated using LsaEnumerateLogonSessions API. This information contains the domain name and the Authentication Package that was used to authenticate the user. Furthermore, it contains the type of logon performed (such as interactive logon).
      PSECURITY_LOGON_SESSION_DATA sessionData = NULL;
      retval = LsaGetLogonSessionData (session, &sessionData);


For more information on LsaGetLogonSessionData, refer to its MSDN documentation (http://msdn2.microsoft.com/en-us/library/aa378290.aspx). If the user is a valid domain user, then we get the drive letter of the USB Drive and send this drive letter to our driver. The driver uses it for encryption/decryption. If the user is not a valid domain user then data read from USB is not decrypted, and the user sees the data as junk since it is encrypted. Although, the above mentioned API’s are documented for Windows Vista, but I have not tested them for Vista. KNOWN LIMITATIONS OF USBCONTROLLER:- 1. For Windows Vista or XP Fast User Switching enabled machines, additional logic has to be implemented to determine which logged on user inserted the USB. That is we have to determine, which logged-in user’s session is currently active among, say 4 user sessions. To know how to do it, kindly mail me. :D

USB File System Filter Driver
The data flow for a file system driver takes place through two distinct interfaces.They are: a) IRP dispatch routines: b) FastIo routines. Hence its obvious that a file system filter driver has to work by intercepting the following requests a) IRPs a.1)Read (Completion Routine) a.2)Write. b)FastIo b.1)FastIoRead b.2)FastIoWrite Intercepting IRPs: a)Read IRP:Occurs when reading from the disk.We decrypt the buffer contents here before sending it to the application.This operation is done in the completion routine of the read. b)Write IRP:Occurs when writing to the disk.We encrypt the buffer contents here before sending it to the disk.This operation is done in the write dispatch routine. Intercepting FastIos: a)FastIoRead:Occurs when the reading is taking place from the cache. We decrypt the buffer contents. b)FastIoWrite:Occurs when the writing is taking place to the Cache.We encrypt the buffer contents here. Other than these two interfaces,the OS may do some memory-mapped IO wherein certain portions of the data/image file is mapped in the memory space within the Os.Next time whenever that file is opened the request for that opening does not reach the file system filter driver and the OS sends the request to the VM manager asking it to extract the requisite data from the mapped portions in memory.

Known Limitations of the Filter Driver
1)There is a “non completed” IRP problem when trying to unload the file system filter driver.This prevents the driver from being stopped and unloaded cleanly. 2)Although all the possible paths ie IRPs,Fast IOs and memory-mapped IO has been dealt with,there still is a problem related to encryption/decryption of certain files like .xls files.

Download
SpringBoot和VueDevOps 发布审批与回滚管理系统源码 包含前后端源码、SQL初始化脚本和启动说明。JDK 17、Spring Boot、Vue;默认H2演示数据库。 立即下载

相关推荐

制造业重点关注的17个Agent智能体落地场景方案.pptx

制造业重点关注的17个Agent智能体落地场景方案.pptx

computer security 复习

网安

zj71hmvx的博客 4607

STM32 FreeRTOS 多任务实战手册:优先级反转、任务栈与 FromISR 坑位

任务莫名其妙卡死、优先级翻转、栈溢出查不到现场——RTOS 的问题几乎都不在 API 调用,而在调度时序和临界区边界。 【10 个专题,每个含复现步骤 / 测量数据 / 判据 / 落地代码】 1. STM32 NVIC中断优先级详解 2. STM32 FreeRTOS 软件定时器实测 3. STM32 FreeRTOS 消息队列 ISR 收发实测 4. STM32 FreeRTOS 优先级反转实测 5. STM32 FreeRTOS StreamBuffer 流缓冲区串口DMA不 6. STM32 FreeRTOS 事件组实测 7. STM32 FreeRTOS 任务栈溢出排查实测 8. STM32 FreeRTOS 堆内存管理实测 9. STM32 FreeRTOS CPU占用率统计实测 10. STM32 移植LwIP+FreeRTOS双任务协同 【这份教程解决什么】 · 每类问题都从「现象 → 可疑层 → 实测判据 → 根因 → 修复动作」走一遍,不停留在寄存器配置说明。 · 代码块与实测表格按专题编号,可直接对照自己的工程定位;目录按专题编号,方便对照查阅。 【适合谁】正在把裸机工程迁到 RTOS、或已经被优先级反转/栈溢出/中断里调 API 坑过的嵌入式工程师。 【形态】PDF 教程,10 个专题 + 速查目录,含代码块与实测数据表。

RSA加密/解密 Decryption error异常解决

RSA加密/解密 Decryption error异常解决 import java.io.ByteArrayOutputStream; import java.security.Key; import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator; import java....

lgxzzz的博客 4866

科技中介服务机构如何构建智能化服务平台以提升服务效率与专业度?.docx

科技中介服务机构如何构建智能化服务平台以提升服务效率与专业度?

政府科技管理者如何高效完成科技成果评价与价值挖掘?.docx

政府科技管理者如何高效完成科技成果评价与价值挖掘?

密码学实验踩过的坑(不定期更新)

JDBCUtils无法找到配置文件路径 把db.properties文件与JDBCUtils类放在同一包内,使用: InputStream in = new FileInputStream(JDBCUtils.class.getResource("db.properties").getPath()); 可获得正确路径 报错:org.apache.commons.dbcp.SQLNestedEx...

weixin_44350049的博客 740

政府科技管理者在推动科技成果转化时,如何高效识别具有高转化潜力的科技成果?.docx

政府科技管理者在推动科技成果转化时,如何高效识别具有高转化潜力的科技成果?

PKCS #5: Password-Based Cryptography Specification Version 2.1 中文翻译

PKCS#5 基于口令的加密规范V2.1 摘要: 本文档提供了实现基于密码的加密的建议,包括密钥派生函数、加密方案、消息验证方案和ASN.1语法识别技术。 本文档是RSA实验室公钥密码标准(PKCS)系列中的PKCS #5 v2.1的再版。通过RFC发布,变更控制被转移到IETF。 该文件也废止了RFC 2898。 备忘录状态 本文档不是Internet标准跟踪规范;它的出版是为了提供信息。 本文档是IETF (Internet Engineering Task Force)的产品。它代表了IETF团体的共

weixin_43586667的博客 1037

【人工智能工程】完结JEV 决策大模型实战,让 AI 从会聊天到能决策

内容概要:本文介绍了JEV决策大模型的核心理念与工程实践,强调将其作为“快判断”层从通用大模型中剥离使用。JEV不生成文本,而是针对明确的状态和问题,输出结构化、带概率的决策结果,适用于高频、原子化的判断任务。文章详细阐述了JEV的工作机制、与通用大模型的本质区别、典型应用场景(如Agent工具路由)、questions的设计方法、能力边界以及兜底机制的重要性,并指出其在成本、延迟和输出确定性方面的优势。; 适合人群:具备一定AI工程实践经验的研发人员、系统架构师,尤其是正在构建Agent、自动化决策系统或优化大模型调用链的技术团队;; 使用场景及目标:①优化高频、轻量级判断任务(如工单分类、内容初筛、RAG相关性判定)的效率与成本;②实现主模型与决策模块的职责分离,提升系统整体稳定性与可维护性;③学习如何设计高质量的判断问题与概率校准机制; 阅读建议:此资源聚焦于决策模型的工程化落地,建议结合实际业务中的判断流程进行POC验证,重点关注questions设计、阈值校准与兜底策略的构建,避免盲目神化JEV的能力。

塔式熔盐光热朗肯循环电站建模及Simulink仿真研究

内容概要:本文围绕塔式熔盐光热朗肯循环电站的建模与Simulink仿真展开系统性研究,重点构建了太阳能集热场、熔盐储热系统及朗肯循环发电单元的数学模型,并基于Simulink平台搭建了完整的集成化仿真系统。研究深入分析了系统的能量转换机制、热力循环特性与动态响应行为,通过设置不同太阳辐照强度、负载变化等工况进行仿真,验证了系统在变工况条件下的运行稳定性与调节能力。同时,系统探讨了熔盐流量、储热容量、换热器效率等关键参数对电站整体热效率与输出功率的影响规律,提出了优化运行策略与参数匹配方案,旨在提升光热电站的能量利用率、运行灵活性与供电可靠性。; 适合人群:具备一定电力系统、热力学或新能源工程背景,从事光热发电、综合能源系统建模与仿真的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于塔式光热电站的教学演示与原理讲解,帮助学生理解光-热-电转换全过程;②为光热系统的设计优化、动态性能评估、控制策略开发(如温度控制、功率调节)提供高保真仿真平台与数据支撑;③支持新型储热调度策略与系统集成方案的验证与测试。; 阅读建议:建议读者结合提供的Simulink模型文件同步操作,深入理解各子系统模块(如集热场、储罐、蒸汽发生器、汽轮机等)的建模逻辑与参数设置方法,重点关注能量流、质量流与控制信号的耦合机制,可进一步在此基础上开发先进控制算法或进行多能互补系统集成研究。

windows实时监测热插拔设备的变化

序:     在21世纪,这个信息时代,热插拔设备是一个巨大的安全隐患。在这个篇文章中,我将介绍一种在用户模式下检测即插即用设备的方法。比如,在系统中插入一个usb设备,ipod,无线网卡等等,都可以在用户模式下检测到,并决定开启或关闭新插入的设备。并且,在文章结尾,我将介绍一下这种方法的优点,以及限制。     怎样检测硬件改变呢?     事实上,windows操作系统在检测到硬件变化时

程序人生的专栏 1万+

多目标粒子群算法求解综合能源系统最优容量配置研究(Matlab代码实现)

内容概要:本文研究了多目标粒子群算法在综合能源系统最优容量配置中的应用,通过Matlab代码实现求解多目标优化问题。文中系统构建了涵盖经济性、环保性和能源利用效率的多目标优化框架,详细阐述了综合能源系统中各类设备的数学模型,并采用改进的多目标粒子群算法进行高效求解,最终获得Pareto最优解集,为综合能源系统的科学规划与可持续发展提供了坚实的理论支撑与实用的技术路径。; 适合人群:具备一定电力系统、优化算法及Matlab编程基础的研究生、科研人员及相关工程技术人员。; 使用场景及目标:①掌握多目标优化问题在综合能源系统容量配置中的建模方法;②学习多目标粒子群算法的实现过程及其在能源系统规划中的具体应用;③通过Matlab代码实践提升算法编程与仿真分析能力。; 阅读建议:建议读者结合Matlab代码逐段理解算法实现细节,重点关注目标函数构建、约束条件处理及Pareto解集的生成过程,同时可尝试调整算法参数以观察优化结果的变化,深化对算法性能的理解。

段错误问题——20190716

段错误问题——20190716 昨天在写代码的时候,碰到了编译成功,但是运行时显示段错误的问题。 添加打印定位到了1006行: pstpdu_InitialUEMessage->protocolIEs->next->next->value.value.decoded.pdu_UserLocationInformation->choice = 2; 发现此处的pdu_...

weixin_44961081的博客 257

科技中介服务机构如何借助智能工具提升服务的专业性与便捷性?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

港股十档行情tick数据,包含逐笔成交与买卖委托快照 逐笔记录含成交时间、价格、成交量、成交方向及委托单类型 十档委托快照提供买卖各十个价位的挂单价格与挂单数量,可观察盘口深度变化 分钟数据以一分钟为

港股十档行情tick数据,包含逐笔成交与买卖委托快照。逐笔记录含成交时间、价格、成交量、成交方向及委托单类型。十档委托快照提供买卖各十个价位的挂单价格与挂单数量,可观察盘口深度变化。分钟数据以一分钟为单位,包含开盘价、最高价、最低价、收盘价、成交量及成交额。历史行情覆盖近十五年,提供完整日线csv表格,字段包含日期、开盘价、最高价、最低价、收盘价、成交量、成交额,部分还包含调整因子或前收盘价。所有数据均为非实时历史数据。 数据源:CMES金融数据库

大神们 求助呀!!!

docker 安装nexus后 查看容器状态Exited (1) 42 minutes ago 报错结果为standard_init_linux.go:219: exec user process caused: permission denied 困扰了好久了,该怎么解决呢

m0_59670025的博客 784

Mplus实战:三变量随机截距交叉滞后模型(RI-CLPM)语法详解与扩展

本文详细解析了Mplus中三变量随机截距交叉滞后模型(RI-CLPM)的构建原理与语法实现。通过将变量分解为稳定的个体间差异与动态的个体内波动,模型能更纯净地揭示多变量间的纵向交互影响。文章以工作压力、睡眠质量与工作满意度为例,提供了完整的语法模板、关键参数设置(如NOCOV命令、残差相关)及结果解读指南,帮助研究者避开常见误区,稳健分析复杂动态关系。

wdx0123456的博客 930

[oracle]今天经历的坑

今天接到的任务:需要处理比对第三方提供的姓名和XX号码,由于信息保密特殊原因,这些数据给到我们这边是通过md5加密的,需要我们匹配我方内部数据是否有对方提供的信息是否核对, 任务需求:匹配加密字段是否一致 任务分析:1.对方文件A 字段 a b c ,其中abc都是通过functionmd5加密 2.我方文件 B通过字段 a b c ....。a...

danny0798的博客 275

嵌入式状态机编程-QP状态机框架与常见状态机方法

状态机基本术语 现态:是指当前所处的状态。 条件:又称为“事件”,当一个条件被满足,将会触发一个动作,或者执行一次状态的迁移。 动作:条件满足后执行的动作。动作执行完毕后,可以迁移到新的状态,也可以仍旧保持原状态。动作不是必需的,当条件满足后,也可以不执行任何动作,直接迁移到新状态。 次态:条件满足后要迁往的新状态。“次态”是相对于“现态”而言的,“次态”一旦被激活,就转变成新的“现态”了。 传统有限状态机Fsm实现方法 如图,是一个定时计数器,计数器存在两种状态,一种为设置状态,一种为计时状态 设

qq_36969440的博客 9665

VS Code 配置 LaTeX 写作环境完全指南

本文详细介绍了如何在 VS Code 中配置 LaTeX 写作环境,涵盖了从安装必备组件到高级功能的全面指南。首先,用户需要安装 LaTeX 发行版(如 TeX Live 或 MiKTeX)和 VS Code 插件(如 LaTeX Workshop)。接着,通过修改 settings.json 和 keybindings.json 文件,用户可以自定义编译、查看快捷键等基础配置。文章还提供了高效写作技巧,如使用代码片段和多文件项目管理,并介绍了高级功能如反向同步、公式预览和参考文献管理。此外,针对常见问题(

weixin_70043030的博客 1984
上一篇: antivirus protect SSDT hook
下一篇: Bypass FsdFilter
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值