neurodroid / cryptonite

EncFS and TrueCrypt on Android
GNU General Public License v2.0
204 stars 49 forks source link

Open interface to receive commands via Intents/Service #48

Open neurodroid opened 9 years ago

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 16:36:31

I'm currently writing some medical software to be used in developing countries, and I would love to use EncFS (or possibly TrueCrypt) to encrypt the whole filesystem.

Ideally I would be able to send an Intent to Cryptonite, or to access a Service where I could call some basic commands. Just basic functionality like encrypting a folder, mounting a folder, and unmounting.

Thanks very much for the excellent software you've made here. I spent a long time trying to figure out how to accomplish this before finding Cryptonite, so I'm humbled by your accomplishment here.

Nick

Original issue: http://code.google.com/p/cryptonite/issues/detail?id=48

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 08:38:02

I apologize for marking this as "Defect", that was unintentional!

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on January 15, 2013 09:08:28

Thanks for your comments. Do you have any experience with Android programming? I currently don't have enough time for adding features and would certainly appreciate some help.

Status: Accepted

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 10:20:50

I do, and would be happy to help.

My problem is that I'm not good at native programming and I have trouble dealing with any NDK issues. But if I put a few classes in my clone of your repo, would you be willing to integrate it?

Also, I had quite some trouble just trying to build all your code! If you could build me an APK that includes the classes I write, I would greatly appreciate it!

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on January 15, 2013 10:51:56

I'd be happy to build an apk for you. However, it would be difficult for you to debug it in case you make small changes to the code. Alternatively, I could upload a pre-built archive of all the native stuff so that you only need to build the Java part.

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 10:54:37

Also, here's the issue I'm having building EncFS myself. When I run download.sh I get this: / 2013-01-15 13:49:33 (1.06 MB/s) - `encfs-1.7.4.tgz' saved [931048/931048]

patching file encfs/DirNode.cpp patching file encfs/FSConfig.h patching file encfs/FileNode.cpp patching file encfs/FileUtils.cpp patching file encfs/FileUtils.h patching file encfs/RawFileIO.cpp patching file encfs/encfs.cpp patching file encfs/encfsctl.cpp patching file encfs/main.cpp patching file configure.ac sed: 1: ".//encfs/base64.cpp": invalid command code . sed: 1: ".//encfs/base64.h": invalid command code . sed: 1: ".//encfs/BlockFileIO.cpp": invalid command code . sed: 1: ".//encfs/BlockFileIO.h": invalid command code . sed: 1: ".//encfs/BlockNameIO.cpp": invalid command code . sed: 1: ".//encfs/BlockNameIO.h": invalid command code . sed: 1: ".//encfs/boost-versioni ...": invalid command code . sed: 1: ".//encfs/Cipher.cpp": invalid command code . sed: 1: ".//encfs/Cipher.h": invalid command code . sed: 1: ".//encfs/CipherFileIO.cpp": invalid command code . sed: 1: ".//encfs/CipherFileIO.h": invalid command code . sed: 1: ".//encfs/CipherKey.cpp": invalid command code . sed: 1: ".//encfs/CipherKey.h": invalid command code . sed: 1: ".//encfs/ConfigReader.cpp": invalid command code . sed: 1: ".//encfs/ConfigReader.h": invalid command code . sed: 1: ".//encfs/ConfigVar.cpp": invalid command code . sed: 1: ".//encfs/ConfigVar.h": invalid command code . sed: 1: ".//encfs/Context.cpp": invalid command code . sed: 1: ".//encfs/Context.h": invalid command code . sed: 1: ".//encfs/DirNode.cpp": invalid command code . sed: 1: ".//encfs/DirNode.h": invalid command code . sed: 1: ".//encfs/encfs.cpp": invalid command code . sed: 1: ".//encfs/encfs.h": invalid command code . sed: 1: ".//encfs/encfsctl.cpp": invalid command code . sed: 1: ".//encfs/FileIO.cpp": invalid command code . sed: 1: ".//encfs/FileIO.h": invalid command code . sed: 1: ".//encfs/FileNode.cpp": invalid command code . sed: 1: ".//encfs/FileNode.h": invalid command code . sed: 1: ".//encfs/FileUtils.cpp": invalid command code . sed: 1: ".//encfs/FileUtils.h": invalid command code . sed: 1: ".//encfs/FSConfig.h": invalid command code . sed: 1: ".//encfs/i18n.h": invalid command code . sed: 1: ".//encfs/Interface.cpp": invalid command code . sed: 1: ".//encfs/Interface.h": invalid command code . sed: 1: ".//encfs/MACFileIO.cpp": invalid command code . sed: 1: ".//encfs/MACFileIO.h": invalid command code . sed: 1: ".//encfs/main.cpp": invalid command code . sed: 1: ".//encfs/makeKey.cpp": invalid command code . sed: 1: ".//encfs/MemoryPool.cpp": invalid command code . sed: 1: ".//encfs/MemoryPool.h": invalid command code . sed: 1: ".//encfs/Mutex.h": invalid command code . sed: 1: ".//encfs/NameIO.cpp": invalid command code . sed: 1: ".//encfs/NameIO.h": invalid command code . sed: 1: ".//encfs/NullCipher.cpp": invalid command code . sed: 1: ".//encfs/NullCipher.h": invalid command code . sed: 1: ".//encfs/NullNameIO.cpp": invalid command code . sed: 1: ".//encfs/NullNameIO.h": invalid command code . sed: 1: ".//encfs/openssl.cpp": invalid command code . sed: 1: ".//encfs/openssl.h": invalid command code . sed: 1: ".//encfs/Range.h": invalid command code . sed: 1: ".//encfs/RawFileIO.cpp": invalid command code . sed: 1: ".//encfs/RawFileIO.h": invalid command code . sed: 1: ".//encfs/readpassphrase ...": invalid command code . sed: 1: ".//encfs/readpassphrase.h": invalid command code . sed: 1: ".//encfs/SSL_Cipher.cpp": invalid command code . sed: 1: ".//encfs/SSL_Cipher.h": invalid command code . sed: 1: ".//encfs/StreamNameIO.cpp": invalid command code . sed: 1: ".//encfs/StreamNameIO.h": invalid command code . sed: 1: ".//encfs/test.cpp": invalid command code . sed: 1: ".//intl/autosprintf.cpp": invalid command code . sed: 1: ".//intl/autosprintf.h": invalid command code . sed: 1: ".//intl/gettext.h": invalid command code . ./download.sh: line 12: autoreconf: command not found

Then when I run build.sh the outcome ends with this:

checking whether the Boost::System library is available... yes configure: WARNING: BOOST_CPPFLAGS -I/Users/Nick/Documents/workspace/cryptonite/encfs-1.7.4/encfs-1.7.4/../../boost/boost_1_46_1/android/include checking whether the Boost::Serialization library is available... yes configure: error: Could not link against ! make: * No rule to make target `clean'. Stop. make: * No targets specified and no makefile found. Stop. make: Nothing to be done for`install'. /Users/Nick/android-toolchain/bin/arm-linux-androideabi-strip: 'armeabi-v7a/bin/encfs': No such file Traceback (most recent call last): File "./cplibs-static.py", line 27, in shell=True) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in init errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory: './encfs-1.7.4/armeabi/bin'

Not sure if this is an issue with the trunk, but I don't know how to get around it.

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 11:26:57

If I had the prebuilt binaries then I'd be able to write it easily! If you could send those to me then I'd get to work on this.

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on January 15, 2013 11:35:50

If you're on OS X and have MacPorts installed, try to do $ sudo port install gsed Make sure that $ which sed returns /opt/local/bin/sed Then, try again. I'll follow up with prebuilt binaries later this week.

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 11:55:18

Thanks!

I installed sed, and the "which" command found it at /usr/bin/sed, not opt/local/bin. I looked in opt/local/bin and there's no sed file there.

No worries about trying to debug my computer from afar, I think this is just more than I'll ever be able to handle!

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on January 15, 2013 12:23:58

You're actually very very close. The worst part concerning the native library is done. I've just committed a change to download.sh. Remove the old source directory and try again: $ cd ${CRYPTONITE}/encfs-1.7.4 $ rm -rf encfs-1.7.4 $ ./download.sh $ ./build.sh

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on January 15, 2013 12:34:23

Forgot to add: You need to do $ cd ${CRYPTONITE} $ git pull before trying again

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 12:55:07

I pulled the change from the download.sh file but I still get these errors. I installed libtools and autoconf with port, that changed the last part of the error, but I"m not sure it's particularly helpful...

patching file encfs/DirNode.cpp patching file encfs/FSConfig.h patching file encfs/FileNode.cpp patching file encfs/FileUtils.cpp patching file encfs/FileUtils.h patching file encfs/RawFileIO.cpp patching file encfs/encfs.cpp patching file encfs/encfsctl.cpp patching file encfs/main.cpp patching file configure.ac sed: 1: ".//encfs/base64.cpp": invalid command code . sed: 1: ".//encfs/base64.h": invalid command code . sed: 1: ".//encfs/BlockFileIO.cpp": invalid command code . sed: 1: ".//encfs/BlockFileIO.h": invalid command code . sed: 1: ".//encfs/BlockNameIO.cpp": invalid command code . sed: 1: ".//encfs/BlockNameIO.h": invalid command code . sed: 1: ".//encfs/boost-versioni ...": invalid command code . sed: 1: ".//encfs/Cipher.cpp": invalid command code . sed: 1: ".//encfs/Cipher.h": invalid command code . sed: 1: ".//encfs/CipherFileIO.cpp": invalid command code . sed: 1: ".//encfs/CipherFileIO.h": invalid command code . sed: 1: ".//encfs/CipherKey.cpp": invalid command code . sed: 1: ".//encfs/CipherKey.h": invalid command code . sed: 1: ".//encfs/ConfigReader.cpp": invalid command code . sed: 1: ".//encfs/ConfigReader.h": invalid command code . sed: 1: ".//encfs/ConfigVar.cpp": invalid command code . sed: 1: ".//encfs/ConfigVar.h": invalid command code . sed: 1: ".//encfs/Context.cpp": invalid command code . sed: 1: ".//encfs/Context.h": invalid command code . sed: 1: ".//encfs/DirNode.cpp": invalid command code . sed: 1: ".//encfs/DirNode.h": invalid command code . sed: 1: ".//encfs/encfs.cpp": invalid command code . sed: 1: ".//encfs/encfs.h": invalid command code . sed: 1: ".//encfs/encfsctl.cpp": invalid command code . sed: 1: ".//encfs/FileIO.cpp": invalid command code . sed: 1: ".//encfs/FileIO.h": invalid command code . sed: 1: ".//encfs/FileNode.cpp": invalid command code . sed: 1: ".//encfs/FileNode.h": invalid command code . sed: 1: ".//encfs/FileUtils.cpp": invalid command code . sed: 1: ".//encfs/FileUtils.h": invalid command code . sed: 1: ".//encfs/FSConfig.h": invalid command code . sed: 1: ".//encfs/i18n.h": invalid command code . sed: 1: ".//encfs/Interface.cpp": invalid command code . sed: 1: ".//encfs/Interface.h": invalid command code . sed: 1: ".//encfs/MACFileIO.cpp": invalid command code . sed: 1: ".//encfs/MACFileIO.h": invalid command code . sed: 1: ".//encfs/main.cpp": invalid command code . sed: 1: ".//encfs/makeKey.cpp": invalid command code . sed: 1: ".//encfs/MemoryPool.cpp": invalid command code . sed: 1: ".//encfs/MemoryPool.h": invalid command code . sed: 1: ".//encfs/Mutex.h": invalid command code . sed: 1: ".//encfs/NameIO.cpp": invalid command code . sed: 1: ".//encfs/NameIO.h": invalid command code . sed: 1: ".//encfs/NullCipher.cpp": invalid command code . sed: 1: ".//encfs/NullCipher.h": invalid command code . sed: 1: ".//encfs/NullNameIO.cpp": invalid command code . sed: 1: ".//encfs/NullNameIO.h": invalid command code . sed: 1: ".//encfs/openssl.cpp": invalid command code . sed: 1: ".//encfs/openssl.h": invalid command code . sed: 1: ".//encfs/Range.h": invalid command code . sed: 1: ".//encfs/RawFileIO.cpp": invalid command code . sed: 1: ".//encfs/RawFileIO.h": invalid command code . sed: 1: ".//encfs/readpassphrase ...": invalid command code . sed: 1: ".//encfs/readpassphrase.h": invalid command code . sed: 1: ".//encfs/SSL_Cipher.cpp": invalid command code . sed: 1: ".//encfs/SSL_Cipher.h": invalid command code . sed: 1: ".//encfs/StreamNameIO.cpp": invalid command code . sed: 1: ".//encfs/StreamNameIO.h": invalid command code . sed: 1: ".//encfs/test.cpp": invalid command code . sed: 1: ".//intl/autosprintf.cpp": invalid command code . sed: 1: ".//intl/autosprintf.h": invalid command code . sed: 1: ".//intl/gettext.h": invalid command code . configure.ac:14: error: 'AM_CONFIG_HEADER': this macro is obsolete. You should use the 'AC_CONFIG_HEADERS' macro instead. /opt/local/share/aclocal-1.13/obsolete-err.m4:12: AM_CONFIG_HEADER is expanded from... configure.ac:14: the top level autom4te: /opt/local/bin/gm4 failed with exit status: 1 aclocal: error: echo failed with exit status: 1 autoreconf: aclocal failed with exit status: 1

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on January 15, 2013 12:59:32

sed still doesn't seem to work, and there seems to be yet another problem with autoconf. I'll try to get my hands on a Mac to reproduce this. Thanks for reporting.

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 13:01:52

Actually I found a little typo in the code you committed that removed sed from the equation... you had this: sed -i"" 's/off_t/loff_t/g' {} \;

which I changed to this: sed -i "" 's/off_t/loff_t/g' {} \;

There was a space missing after the -i argument. It still gives me errors, but no longer involving sed:

patching file encfs/DirNode.cpp patching file encfs/FSConfig.h patching file encfs/FileNode.cpp patching file encfs/FileUtils.cpp patching file encfs/FileUtils.h patching file encfs/RawFileIO.cpp patching file encfs/encfs.cpp patching file encfs/encfsctl.cpp patching file encfs/main.cpp patching file configure.ac configure.ac:14: error: 'AM_CONFIG_HEADER': this macro is obsolete. You should use the 'AC_CONFIG_HEADERS' macro instead. /opt/local/share/aclocal-1.13/obsolete-err.m4:12: AM_CONFIG_HEADER is expanded from... configure.ac:14: the top level autom4te: /opt/local/bin/gm4 failed with exit status: 1 aclocal: error: echo failed with exit status: 1 autoreconf: aclocal failed with exit status: 1

neurodroid commented 9 years ago

From nwil...@gmail.com on January 15, 2013 14:11:13

So apparently there is a line in "/encfs-1.7.4/configure" that tests:

if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : BOOST_SYSTEM_LIB="-l$ax_lib"; link_system="yes"; break else link_system="no" fi

and $as_ac_Lib is empty, so it gives an error, Not sure if that will help, but it's as far as I could take it.

Oh I also took its advice and changed AM_CONFIG_HEADER to AC_CONFIG_HEADERS in configure.ac and that got rid of the download error. It was occuring during the command "autoreconf --force".

neurodroid commented 9 years ago

From akkiraju...@gmail.com on April 02, 2013 07:00:12

I am trying to compile encfs on ubuntu 12.04,32bit.I am able to successfully compile boost,OpenSSL,Fuse28,rlog but when i tried to compile encfs i see the following issues .

collect2: ld returned 1 exit status make[1]: * [encfs] Error 1 make[1]: Leaving directory `/media/Tutorial1/Andriod@Teja/SVN/Security/cryptonite/encfs-1.7.4/encfs-1.7.4/encfs' make: * [install-recursive] Error 1 /home/surya/android-toolchain/bin/arm-linux-androideabi-strip: 'armeabi-v7a/bin/encfs': No such file Traceback (most recent call last): File "./cplibs-static.py", line 27, in shell=True) File "/usr/lib/python2.7/subprocess.py", line 679, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory: './encfs-1.7.4/armeabi/bin'

Kindly help me in this regard..I am trying to fix the problem from many a days..Eagerly waiting for the help

neurodroid commented 9 years ago

From christoph.schmidthieber@gmail.com on April 02, 2013 16:00:45

@akkirajusuryatej: I've just pushed r6809f68bd437 to build with the latest NDK and SDK, updated the BuildInstructions accordingly, and tested with Ubuntu 12.04, where it worked fine. Please update your git repository and follow the updated instructions. Let me know if you run into any problems.

neurodroid commented 9 years ago

From akkiraju...@gmail.com on April 02, 2013 18:41:19

Thanks a lot for your reply.I would try as you said and will update you the status.

neurodroid commented 9 years ago

From akkiraju...@gmail.com on April 02, 2013 22:01:50

Thanks a lot christoph.schmidthieber .It really worked well.I appreciate your work