LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-07-2014, 10:26 AM   #1
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Rep: Reputation: 11
Question NCrypt - unable to use Serpent (?)


Hi all,

I have been using ncrypt ( 0.5.5, 0.6.11, 0.7.0 ) with Rijndael/aes.
After en-/de-crypting using Serpent the contents of the file turns into garbage:

Code:
$ ncrypt -e -s -i NEWS -o NEWS.ncr
$ ncrypt -d -s -i NEWS.ncr -o NEWS.dec

$ md5sum NEWS*
2ca37b5f91a097415ab4a9cf35034039  NEWS
2ac5e53cdc14166e2106d2a319858337  NEWS.dec
b401ee66fd6e08091f36ea4a27dd916c  NEWS.ncr
I tried to do the same on a 32bit box, same result. I also imported the key ( -k ) from a file... no difference.

Any ideas?

Mike

Last edited by paziulek; 07-07-2014 at 11:11 AM.
 
Old 07-07-2014, 10:56 AM   #2
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Original Poster
Rep: Reputation: 11
I did recompile 0.6.11 on a 32bit box ( statically ) and moved it to the 64bit... it en- & de-crypts properly...

I got no idea what is going on...


gcc on 64bit:
Quote:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.2/work/gcc-4.5.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.2/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.2 p1.1, pie-0.4.5'
Thread model: posix
gcc version 4.5.2 (Gentoo 4.5.2 p1.1, pie-0.4.5)

and 32:
Quote:
$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.4.3-r2/work/gcc-4.4.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.4.3 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.4.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.3/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.4.3/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/i686-pc-linux-gnu/4.4.3/python --enable-checking=release --disable-libgcj --with-arch=i686 --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.4.3-r2 p1.2'
Thread model: posix
gcc version 4.4.3 (Gentoo 4.4.3-r2 p1.2)

Last edited by paziulek; 07-07-2014 at 10:59 AM.
 
Old 07-07-2014, 11:01 AM   #3
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
ncrypt was last updated in 2005. You may want to migrate to something else.

I can confirm that the ncrypt serpent implementation is broken. I suppose I could try to fix it, but it is better just to find another program.
 
1 members found this post helpful.
Old 07-07-2014, 11:10 AM   #4
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by metaschima View Post
ncrypt was last updated in 2005. You may want to migrate to something else.

I can confirm that the ncrypt serpent implementation is broken. I suppose I could try to fix it, but it is better just to find another program.
Thank you very much!
I thought the system hardware is broken....

Well, the 32bit static works fine(if there is a need for that) - otherwise I will find an alternative...

Thanks again!

Mike
 
Old 07-07-2014, 11:48 AM   #5
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I fixed it, but let me clean the code up a bit and I'll post the solution.

They used 'unsigned long' which is 4 bytes on 32-bit systems and 8-bytes on 64-bit systems. So, I removed all 'unsigned long' and replaced them with 'uint32_t' from the stdint.h standard library definition. This fixes the problem.
 
1 members found this post helpful.
Old 07-07-2014, 12:37 PM   #6
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Ok, I attached a working version of ncrypt. Change the ending to '.txz' and extract it. It should compile and work now.

I couldn't fix all the type conversion warnings, but they're not serious.
Attached Files
File Type: log ncrypt-0.7.0.log (130.2 KB, 12 views)
 
1 members found this post helpful.
Old 07-08-2014, 10:19 AM   #7
paziulek
Member
 
Registered: Mar 2009
Location: N.C.
Distribution: "gentoo|debian|arch"
Posts: 106

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by metaschima View Post
Ok, I attached a working version of ncrypt. Change the ending to '.txz' and extract it. It should compile and work now.

I couldn't fix all the type conversion warnings, but they're not serious.


Perfect! Thank you metaschima !

EDIT:

There is one problem with the modified code: it does not accept passwords imported from a file...

ncrypt: unable to find a password in file ./a

Last edited by paziulek; 07-08-2014 at 10:38 AM.
 
  


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
Unable to boot RHEL 5.2 and Unable to mount root file system in rescue mode vknemannavar Red Hat 5 01-29-2010 09:05 AM
Unable to use wget and unable to ping machine from external source grunshaw Linux - Networking 3 10-24-2006 08:46 AM
Unable to Build ELDK3.1 for kernel 2.4.25. On Booting Unable to mount root fs.. kannath Debian 0 05-11-2006 09:26 AM
Unable to logon on as non-root user after update as unable to set executable context pls198 Fedora 2 04-09-2004 11:41 AM
Volume control is unable to run correctly. Unable to open audio device '/dev/mixer'. sevenreams Slackware 1 05-16-2003 07:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:04 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