阅读:4483回复:22
利用驱动程序给Usb硬盘加密!--高手请指点!(40)分
我想改微软的Umss for 98,在98下利用这个驱动程序对硬盘进行加密。
思想是当写usb硬盘的时候加密数据,在写usb硬盘。 当读usb硬盘的时候,将读出来的数据进行解密。 中间过程对上层vxd,win32透明! 问题是如何获得写硬盘和读硬盘的数据! |
|
沙发#
发布于:2002-04-19 17:00
????????????????????????????????????????????
Copyright (c) 1999-2001 Microsoft Corporation Module Name: BulkOnly.c ?????????????????????????????????????? VOID UMSS_BulkOnlyTransferData( PDEVICE_EXTENSION DeviceExtension ) /*++ Routine Description: Schedules a bulk data transfer to/from the device. Arguments: DeviceExtension - Our FDO\'s device extension. Return Value: NONE --*/ { PVOID DataBuffer; ULONG DataBufferLength; ENTER(UMSS_BulkOnlyTransferData); // Steps for data phase // 1. Get data buffer fragment (either SGD list, flat buffer, or none). // 2. Schedule data transfer if neccessary. // 3. Repeat 1-2 until all data transferred, or endpoint stalls. // 4. Move to status phase. // Get next data buffer element, if any DataBuffer = UMSS_GetBuffer(DeviceExtension, &DataBufferLength); if (NULL == DataBuffer) { //No data to transfer, so move to status phase UMSS_BulkOnlyGetStatus(DeviceExtension); } else { // Schedule the data transfer. // Calls UMSS_BulkOnlyTransferDataComplete when transfer completes. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if(DATA_IN) { encrypt(DataBuffer, DataBufferLength) } //________________________________________________________ UMSS_BulkTransfer( DeviceExtension, (UCHAR)((DeviceExtension->IoPacket->Flags & IO_FLAGS_DATA_IN) ? DATA_IN : DATA_OUT), DataBuffer, DataBufferLength, UMSS_BulkOnlyTransferDataComplete ); //++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if(DATA_OUT) { Decrypt(DataBuffer, DataBufferLength) } //________________________________________________________ } EXIT(UMSS_BulkOnlyTransferData); } :P |
|
|
板凳#
发布于:2002-04-19 17:03
Copyright (c) 1999-2001 Microsoft Corporation Module Name: BulkOnly.c :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P VOID UMSS_BulkOnlyTransferData( PDEVICE_EXTENSION DeviceExtension ) /*++ Routine Description: Schedules a bulk data transfer to/from the device. Arguments: DeviceExtension - Our FDO\'s device extension. Return Value: NONE --*/ { PVOID DataBuffer; ULONG DataBufferLength; ENTER(UMSS_BulkOnlyTransferData); // Steps for data phase // 1. Get data buffer fragment (either SGD list, flat buffer, or none). // 2. Schedule data transfer if neccessary. // 3. Repeat 1-2 until all data transferred, or endpoint stalls. // 4. Move to status phase. // Get next data buffer element, if any DataBuffer = UMSS_GetBuffer(DeviceExtension, &DataBufferLength); if (NULL == DataBuffer) { //No data to transfer, so move to status phase UMSS_BulkOnlyGetStatus(DeviceExtension); } else { // Schedule the data transfer. // Calls UMSS_BulkOnlyTransferDataComplete when transfer completes. if(in) Encrypt(DataBuffer); UMSS_BulkTransfer( DeviceExtension, (UCHAR)((DeviceExtension->IoPacket->Flags & IO_FLAGS_DATA_IN) ? DATA_IN : DATA_OUT), DataBuffer, DataBufferLength, UMSS_BulkOnlyTransferDataComplete ); if(out) decrypt(DataBuffer); } EXIT(UMSS_BulkOnlyTransferData); } :P |
|
|
地板#
发布于:2002-04-19 17:07
这个方法我已经试过了,出现了问题!
1.更本就没有数据读(DATA_IN)的内容。 2.你如果打印数据传输的大小的时候,发现传输的大小和原来文件的大小 不一样,而且还包括许多的不知道的传输。 比如写硬盘的时候竟然会有读的数据。 比如: if(DATA_IN) DebugPrint(\"the transfer is In\"); else DebugPrint(\"the transfer is out\"); 就会发现很多问题! 但是作为你的回答,我给你5分,谢谢你。 |
|
地下室#
发布于:2002-04-19 17:24
ur F/W may lock or unlock to have security.
|
|
|
5楼#
发布于:2002-04-22 09:02
这个方法我已经试过了,出现了问题! 原因很简单:所有的file i/o命令都是被封装在scsi命令中的,你要从scsi命令中分解出真正的read/write的数据。而这些数据有可能并不是真正的文件的内容! |
|
|
6楼#
发布于:2002-04-22 09:05
ur F/W may lock or unlock to have security. Hi Nouk, I know some products have this features. Could you pls tell us how they implement this? In windows driver or firmware? Thanks |
|
|
7楼#
发布于:2002-04-22 09:40
非常感谢各位的指导。怎么不能给分了?
但是,能不能具体说明一下如何实现的。 还有楼上的那位大虾Nouk,那个Taiwan\'s Driver Developer在那里? |
|
8楼#
发布于:2002-04-22 09:55
[quote]ur F/W may lock or unlock to have security. Hi Nouk, I know some products have this features. Could you pls tell us how they implement this? In windows driver or firmware? Thanks [/quote] The F/W must implement the lock/unlock cmds. And driver or win app to send ASPI cmds to use it. |
|
|
9楼#
发布于:2002-04-22 10:06
hi,Nouk.
are you here? i want to chat with you online. Have you QQ number or email address? I am a new hand,I need help. my qq number is 38580353,and email is danier@km169.net, and you? thz. |
|
10楼#
发布于:2002-04-22 10:14
hi,Nouk. Sorry, I don\'t have OICQ. |
|
|
11楼#
发布于:2002-04-22 10:20
and icq?
I need to settle this question quickly. I need your help! |
|
12楼#
发布于:2002-04-22 10:33
and icq? I send the secret message by the forum. |
|
|
13楼#
发布于:2002-04-22 10:53
ok.
let\'s begin. first, what\'s the way which usb harddisk read or write---Direct I/O,or Buffer. you said that i should use F/W may lock or unlock. I don\'t know what is the F/W,but I know the DMA(Direct way) ask for lock and unlock. second,what is ASPI.how the driver use? third,have you any example.if you have ,could you give me. thz very much. |
|
14楼#
发布于:2002-04-22 11:11
It\'s different.
The way to encrypt the data is complex. The ez way is to author the pwd that the user typed. If right,then unlock the media. F/W is firmware. The USB follow SCSI cmd sets. ASPI is SCSI interface. |
|
|
15楼#
发布于:2002-04-22 11:24
thank you very much.
I get your means. but my boss give me a question is that if you have not the usb driver you can not read or write the usb harddisk envnif you put the usb harddisk to another pc. if you have not driver you you can not get the right data. what shall i do? |
|
16楼#
发布于:2002-04-22 11:47
I know urs. I ever get some info abot the kind of products. 1.The flash can be removable disk. 2.The flash can be dongle/keypro,too (It should be what u want to do) May like \"Virtual CD\",the driver simulates it. ==================================================== Some idea that: Don\'t direct encrypt ur data. To save orginal KEY in PC and hash value in USB. If the driver match the function, then it\'ll be used. |
|
|
17楼#
发布于:2002-04-22 12:34
thank you very very much for your advise.
from your advise: 1.save orginal KEY : the way is using the Register table,yep? but how can do this by writing a dirver or writing it\'s setup file? 2.hash value in usb: Is It a funciton in the driver? let look the driver module:when a win32 app. send a r/w I/O request,it send to the I/O manage organ,and the I/O manage organ send to the right dirver. yep? for a driver,there is not \"main\" or \"Winmain()\" function. so,It depends the I/O manage organ call the function the driver write. you means is add a validing funtion to the r/w function before preform the actully r/w. whether I get your means or not? I get the Windows 98 USB Mass Storage Sample Driver from microsoft.I read it\'s source,and I think the r/w function is umss_bulktransfer function.give me some advise,thz. I just want to change something about this exmaple to complete myquestion. what shall i do? |
|
18楼#
发布于:2002-04-22 16:19
版主:你的意见如何?
给个答复好吗? |
|
19楼#
发布于:2002-04-23 09:46
> 1.save orginal KEY :
> the way is using the Register table,yep? May be or other tips. > 2.hash value in usb: > Is it a funciton in the driver? yes,it\'s a function,be in driver or app. Before r/w,must be matched the value. if not,return error. |
|
|
上一页
下一页