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;
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