<div dir="ltr"><div><div><div>Yeah I was trying something similar only but with a much simpler Caeser cipher function of my own written as below:<br><br>void encrypt(char *data, char *encrypted, size_t size)<br>{<br>    unsigned int i;<br>    for(i=0;i&lt;(unsigned int)size;i++)<br>        encrypted[i] = data[i] + 3;<br>    printk(KERN_INFO &quot;%s&quot;,encrypted);<br>    return;<br>}<br></div><br></div><div>So in the given code wherever u see the calls to <b>wrapfs_encrypt</b>, I have replaced with my simpler encryption function.<br></div><div><br></div>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.<br><br></div>Thanks<br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><b style="font-size:small;font-family:arial"><font face="arial, helvetica, sans-serif" color="#000000">Kunal Baweja</font></b><br></div><img src="http://www.fractalink.com/downloads/color_strip_BITS.jpg"><br><div><div style="font-family:arial;font-size:small"><span style="color:rgb(102,102,102);font-family:arial,helvetica,sans-serif">Undergraduate B.E. (Hons.) Computer Science</span><br></div><div style="font-family:arial;font-size:small"><font face="arial, helvetica, sans-serif"><font color="#666666">Birla Institute Of Technology &amp; Science, Pilani</font><br></font></div><div style="font-family:arial;font-size:small"><font face="arial, helvetica, sans-serif" color="#666666">K.K. Birla Goa Campus</font></div><div style="font-family:arial;font-size:small"><font style="font-weight:bold" face="arial, helvetica, sans-serif" color="#3d85c6">+91 9049655665</font></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Jan 30, 2015 at 4:03 PM, Saket Sinha <span dir="ltr">&lt;<a href="mailto:saket.sinha89@gmail.com" target="_blank">saket.sinha89@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>HI,</div><div><br></div>Kindly refer the following link that implements a minimal encryption over wrapfs.<div><a href="https://github.com/piekill/wrapfs" target="_blank">https://github.com/piekill/wrapfs</a><br><div><br></div><div>Go through the wrapfs_encrypt in wrapfs_readpage and wrapfs_decrypt in wrapfs_writepage.</div></div><div><br></div><div>Regards,</div><div>Saket Sinha</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Jan 30, 2015 at 3:56 PM, Kunal Baweja <span dir="ltr">&lt;<a href="mailto:bawejakunal15@gmail.com" target="_blank">bawejakunal15@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hi,<br></div>I am currently working on implementing a simple encrypted file system using a stackable file system <a href="http://wrapfs.filesystems.org/" target="_blank">WrapFS</a>. In order to do so, as I read in the <a href="http://www.fsl.cs.sunysb.edu/pipermail/wrapfs/2011-November/000058.html" target="_blank">WrapFS mailing list</a> one needs to implement address space operations, which I have done and posted on my github at <a href="https://github.com/bawejakunal/wrapfs-addresspace-operations/blob/master/mmap.c" target="_blank">this link</a> 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.<br></div>Please guide where am I going wrong in modifying the data to be written and what could be the best way to decrypt it ?<br><br></div>Thanks<span><font color="#888888"><br><div><div><br clear="all"><div><div><div><div><div dir="ltr"><div><b style="font-size:small;font-family:arial"><font face="arial, helvetica, sans-serif" color="#000000">Kunal Baweja</font></b><br></div><img src="http://www.fractalink.com/downloads/color_strip_BITS.jpg"><br><div><div style="font-family:arial;font-size:small"><span style="color:rgb(102,102,102);font-family:arial,helvetica,sans-serif">Undergraduate B.E. (Hons.) Computer Science</span><br></div><div style="font-family:arial;font-size:small"><font face="arial, helvetica, sans-serif"><font color="#666666">Birla Institute Of Technology &amp; Science, Pilani</font><br></font></div><div style="font-family:arial;font-size:small"><font face="arial, helvetica, sans-serif" color="#666666">K.K. Birla Goa Campus</font></div><div style="font-family:arial;font-size:small"><font style="font-weight:bold" face="arial, helvetica, sans-serif" color="#3d85c6"><a href="tel:%2B91%209049655665" value="+919049655665" target="_blank">+91 9049655665</a></font></div></div></div></div></div>
</div></div></div></div></font></span></div>
<br></div></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>