Re: when and where shall I encrypt dentry?

2005-02-02 Thread linux-os
The correct place to encrypt or decrypt ANYTHING is
just before access to the "outside" world, i.e., in the
case of a file-system, the reads and writes to the
storage device (disk drive). You are in a world of
hurt if you intend to encrypt 'data' and directories
separately.
If you need to use an existing file-system and then
encrypt it, you use the same technique but your
"storage device" is a "container file" that you mount
using the loop device. This allows you to have an
encrypted file-system below some mount-point and
a normal file-system above.
FYI, there are existing tools/code that allow one to
mount an encrypted file-system. Perhaps your masters
project just got easier?
On Wed, 2 Feb 2005, Vineet Joglekar wrote:
Hi all,
I am trying to add some cryptographic functionality to ext2 file system for my 
masters project. I am working with kernel 2.4.21
Along with regular files, I intend to encrypt directory contents too. For 
reading I guess the function ext2_get_page in fs/ext2/dir.c is used. Hence I 
can put my decryption routine in that function. Is that correct?
I was trying to look for the routine which writes the dentry on disk, but was 
unable to find it. I found out that the function d_instantiate is used to fill 
in inode information for a dentry, but unable to see when it is written on 
disk. I suppose that I have to encrypt the dentry just before writing on to the 
disk, as if i encrypt it before, other functions using it wont be able to 
access until they decrypt. So please help me with this, that when and where 
shall I encrypt the directory contents.
Thanks and regards,
Vineet
___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
 Notice : All mail here is now cached for review by Dictator Bush.
 98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: __init()

2005-08-11 Thread linux-os \(Dick Johnson\)

On Thu, 11 Aug 2005, raja wrote:

> Hi,
> Is there any way to execute my own __init() instead of default
> __init() while running an executable.
> -

Sure you link your object file with your own instead of using
the default

 gcc -c -o myprog.o myprog.c
 as -o start.o start.S

 ld -o myprog myprog.o start.o /lib/libc.so.6
 |   |  |___ runtime lib
 |   |__ Your startup
 |__ Your program

Startup starts with a label _start. You may have to write it
in assembly. It calls main() and must never return. Instead
it calls exit() with whatever main() returned, to quit.

__init() is some M$ thing. Linux executables start with
_start().

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :


The information transmitted in this message is confidential and may be 
privileged.  Any review, retransmission, dissemination, or other use of this 
information by persons or entities other than the intended recipient is 
prohibited.  If you are not the intended recipient, please notify Analogic 
Corporation immediately - by replying to this message or by sending an email to 
[EMAIL PROTECTED] - and destroy all copies of this information, including any 
attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html