LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-19-2012, 08:40 AM   #1
Aliasgar Batterywala
LQ Newbie
 
Registered: Oct 2011
Posts: 10

Rep: Reputation: Disabled
Unhappy Decryption using AES


i have encrypted file during their creation using AES-256 algorithm in linux kernel (read_write.c) using the following sequence of functions:-
crypto_alloc_cipher()
crypto_cipher_setkey()
crypto_cipher_encrypt_one()
crypto_free_cipher()

the above sequence encrypts the file successfully, but the same sequence with decrypt function (crypto_cipher_decrypt_one()) does not decrypts the file, can anyone help me plz. thanks in advance.
 
Old 01-25-2012, 02:40 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
There are a couple of places in the kernel which use the crypto module: the eCryptfs file system (linux/fs/ecryptfs/) and the 802.11 wireless stack (linux/drivers/staging/rtl8187se/ieee80211/). Both of these use AES.
 
Old 01-27-2012, 08:23 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
Be certain that we are really talking about the kernel's implementation of these ciphers, which are necessarily used for things like VPN, versus the user space implementation of many of these same ciphers.

The bottom line for you, though, Aliasgar, is simply that ... ummm... "you have a bug in your code."

The easiest solution is ... grep the kernel source-tree to find other examples where these routines are used successfully, and very faithfully and very precisely imitate them. Crypto debugging always sux ... ... because you can only see that your code is wrong, but not why.

Last edited by sundialsvcs; 01-27-2012 at 08:25 AM.
 
Old 01-27-2012, 10:01 AM   #4
Aliasgar Batterywala
LQ Newbie
 
Registered: Oct 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
thanks sundialsvcs! can u tell me wat d bug could be, bcoz i tried many things n i saw dat wen i decrypt d file while encrypting only it does it successfully but decrypting separately while reading d file does not work, i think prblm could be in crypto_alloc_cipher(), while encryption i m passing parameters to dis routine as crypto_alloc_cipher("aes",4,32), whether it is correct, while decryption wat values should b passed to dis function, plz reply.thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] encryption and decryption of files during creation using AES algorithm Aliasgar Batterywala Linux - Kernel 1 01-08-2012 01:11 PM
dm-crypt aes-xts-plain64 vs aes-cbc-essiv for volumes > 2TiB Molly Linux - Security 1 09-13-2010 05:24 PM
using aes-i586 instead of just aes whysyn Linux - Security 0 03-07-2007 03:47 PM
Decryption Of Code balakumarthirukonda Linux - Security 1 01-23-2006 12:54 PM
decryption Program ilnli Programming 9 08-04-2004 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration