From mboxrd@z Thu Jan 1 00:00:00 1970 From: devendra.aaru@gmail.com (devendra.aaru) Date: Fri, 30 Jan 2015 06:55:53 -0500 Subject: Intercepting memory mapped files In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Fri, Jan 30, 2015 at 6:48 AM, Kunal Baweja wrote: > Yeah I was trying something similar only but with a much simpler Caeser > cipher function of my own written as below: > > void encrypt(char *data, char *encrypted, size_t size) > { > unsigned int i; > for(i=0;i<(unsigned int)size;i++) > encrypted[i] = data[i] + 3; > This is not caesar's cipher. If your buffer contains alphabets then only you can apply caesar cipher. It should be something like encrypted[i] = (data[i] - 3) % 26; > printk(KERN_INFO "%s",encrypted); > return; > } > > So in the given code wherever u see the calls to *wrapfs_encrypt*, I have > replaced with my simpler encryption function. > > But I am not able to figure out why calling this function creates a > problem, the printk() statement inside the function shows me the correctly > encrypted contents but the file is still blank. > > Thanks > > *Kunal Baweja* > > Undergraduate B.E. (Hons.) Computer Science > Birla Institute Of Technology & Science, Pilani > K.K. Birla Goa Campus > +91 9049655665 > > On Fri, Jan 30, 2015 at 4:03 PM, Saket Sinha > wrote: > >> HI, >> >> Kindly refer the following link that implements a minimal encryption over >> wrapfs. >> https://github.com/piekill/wrapfs >> >> Go through the wrapfs_encrypt in wrapfs_readpage and wrapfs_decrypt in >> wrapfs_writepage. >> >> Regards, >> Saket Sinha >> >> On Fri, Jan 30, 2015 at 3:56 PM, Kunal Baweja >> wrote: >> >>> Hi, >>> I am currently working on implementing a simple encrypted file system >>> using a stackable file system WrapFS . >>> In order to do so, as I read in the WrapFS mailing list >>> >>> one needs to implement address space operations, which I have done and >>> posted on my github at this link >>> >>> and it works fine. But now when I am trying to modify the data before being >>> written in wrapfs_lower() function I get a blank output in files written >>> out. >>> Please guide where am I going wrong in modifying the data to be written >>> and what could be the best way to decrypt it ? >>> >>> Thanks >>> >>> *Kunal Baweja* >>> >>> Undergraduate B.E. (Hons.) Computer Science >>> Birla Institute Of Technology & Science, Pilani >>> K.K. Birla Goa Campus >>> +91 9049655665 >>> >>> _______________________________________________ >>> Kernelnewbies mailing list >>> Kernelnewbies at kernelnewbies.org >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >>> >>> >> > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150130/f63f93e7/attachment.html