├── .classpath ├── .gitignore ├── .project ├── AndroidManifest.xml ├── LICENSE ├── README.md ├── icon512.xcf ├── libs ├── CACHEWORD_LICENSE ├── IOCipher-v0.3-2-g926b982.jar ├── SQLCIPHER_LICENSE ├── android-support-v4.jar ├── android-support-v4.jar.properties ├── armeabi-v7a │ ├── libiocipher.so │ ├── libsqlcipher_android.so │ ├── libstlport_shared.so │ └── sqlfscat ├── armeabi │ ├── libiocipher.so │ ├── libsqlcipher_android.so │ ├── libstlport_shared.so │ └── sqlfscat ├── cachewordlib-v0.1-3-g71cc426-debug.jar ├── jcodec.jar ├── svg-android.jar └── x86 │ ├── libiocipher.so │ ├── libsqlcipher_android.so │ ├── libstlport_shared.so │ └── sqlfscat ├── project.properties ├── res ├── drawable │ ├── audio.png │ ├── folder.png │ ├── ic_action_camera.png │ ├── ic_action_secure.png │ ├── ic_action_switch_camera.png │ ├── ic_action_switch_video.png │ ├── ic_action_video.png │ ├── ic_launcher.png │ ├── jpeg.png │ ├── mp4.png │ ├── splash.png │ ├── text.png │ └── videoclip.png ├── layout-land │ ├── activity_gallery.xml │ └── base_camera.xml ├── layout │ ├── activity_gallery.xml │ ├── activity_lock_screen.xml │ ├── base_camera.xml │ ├── gallery_gridsq.xml │ ├── pzsimageview.xml │ └── videoview.xml ├── menu │ └── main.xml └── values │ ├── colors.xml │ └── strings.xml ├── src └── info │ └── guardianproject │ └── iocipher │ └── camera │ ├── AudioRecorderActivity.java │ ├── CameraBaseActivity.java │ ├── GalleryActivity.java │ ├── LockScreenActivity.java │ ├── MediaConstants.java │ ├── StillCameraActivity.java │ ├── StorageManager.java │ ├── VideoCameraActivity.java │ ├── encoders │ ├── AACHelper.java │ ├── ImageToH264MP4Encoder.java │ ├── ImageToMJPEGMOVMuxer.java │ ├── ImageToVP8Encoder.java │ └── YUVtoWebmMuxer.java │ ├── io │ ├── IOCipherContentProvider.java │ └── IOCipherFileChannelWrapper.java │ └── viewer │ ├── ImageViewerActivity.java │ ├── MjpegInputStream.java │ ├── MjpegView.java │ ├── MjpegViewerActivity.java │ ├── PZSImageView.java │ ├── StreamOverHttp.java │ └── VideoViewerActivity.java └── web_hi_res_512.png /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | gen/ 3 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CameraCipherLibrary 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 105 | 106 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This file contains the license for IOCipher Camera Library "CipherCam". 2 | 3 | For more information about IOCipher, see https://guardianproject.info/code/iocipher 4 | and this sample library: https://github.com/n8fr8/IOCipherCameraExample 5 | 6 | If you got this file as a part of a larger bundle, there may be other 7 | license terms that you should be aware of. 8 | =============================================================================== 9 | IOCipher Camera Sample is distributed under this license (aka the 3-clause BSD license) 10 | 11 | Copyright (C) 2014-2014 Nathan Freitas 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are 15 | met: 16 | 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the following disclaimer 22 | in the documentation and/or other materials provided with the 23 | distribution. 24 | 25 | * Neither the names of the copyright owners nor the names of its 26 | contributors may be used to endorse or promote products derived from 27 | this software without specific prior written permission. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Camera Cipher Library 3 | ================ 4 | 5 | This is an library and example app for the IOCipher framework, which provides encrypted virtual disks for Android. 6 | 7 | This example demonstrates how to capture a still photo (as an in memory byte[] array) directly from the Camera sensor, store that as an encrypted JPEG file directly inside of IOCipher, and then later share that file as a in-memory byte[] or a stream directly from a ContentProvider. It also handles recording video with audio in the same manner, using the MJPEG MP4 Format and Raw PCM audio. 8 | 9 | The example also provides two basic media viewer activities for photos and video. This provides an in-app mechanism for securely displaying media stored in IOCipher, without having to export the media to a file or share it with another app. These are very simple activities for now, but demonstrate the basic premise of how to extract and render media data from IOCipher. 10 | 11 | This example also uses the CacheWord library at https://github.com/guardianproject/cacheword to manage keys and passphrases. 12 | 13 | Finally, all media processing is done using the latest code from JCodec at http://jcodec.org/ 14 | 15 | Please report bugs here: 16 | https://dev.guardianproject.info/projects/iocipher/issues 17 | 18 | Find out all about IOCipher here: 19 | https://guardianproject.info/code/iocipher/ 20 | 21 | We'd like to hear from you if you have included IOCipher in your app! 22 | support@guardianproject.info 23 | 24 | MjpegView code originally sourced from various samples and threads. More information at: 25 | https://github.com/elleryq/MjpegSample 26 | 27 | SVG-Android library available at: 28 | https://github.com/pents90/svg-android 29 | 30 | Some icons courtesy of: http://www.pelfusion.com/ 31 | and http://www.iconarchive.com/show/flat-folder-icons-by-pelfusion/Empty-Folder-icon.html 32 | (free for non-commercial use) 33 | -------------------------------------------------------------------------------- /icon512.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/icon512.xcf -------------------------------------------------------------------------------- /libs/CACHEWORD_LICENSE: -------------------------------------------------------------------------------- 1 | This file contains the license for CacheWord. 2 | 3 | For more information about CacheWord, see https://guardianproject.info/ 4 | 5 | If you got this file as a part of a larger bundle, there may be other 6 | license terms that you should be aware of. 7 | =============================================================================== 8 | CacheWord is distributed under this license (aka the 3-clause BSD license) 9 | 10 | Copyright (C) 2013-2014 Abel Luck 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are 14 | met: 15 | 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the following disclaimer 21 | in the documentation and/or other materials provided with the 22 | distribution. 23 | 24 | * Neither the names of the copyright owners nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | -------------------------------------------------------------------------------- /libs/IOCipher-v0.3-2-g926b982.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/IOCipher-v0.3-2-g926b982.jar -------------------------------------------------------------------------------- /libs/SQLCIPHER_LICENSE: -------------------------------------------------------------------------------- 1 | == SQLite Cipher == 2 | 3 | SQLite Cipher is an SQLite extension that provides transparent 256 bit AES encryption of database files. 4 | Pages are encrypted before being written to disk and are decrypted when read back. 5 | 6 | Encryption is provided by the OpenSSL crypto library. 7 | 8 | SQLite Cipher was initially developed by Stephen Lombardo at Zetetic LLC (sjlombardo@zetetic.net) to provide 9 | the encrypted database layer for Strip, an iPhone data vault and password manager ( http://www.zetetic.net/products/strip ). 10 | 11 | The official SQLCipher software site can be found at http://www.zetetic.net/software/sqlcipher 12 | 13 | Issues or support questions on using SQLCipher should be entered into the GitHub Issue tracker: 14 | 15 | http://github.com/sjlombardo/sqlcipher/issues 16 | 17 | Please DO NOT post issues, support questions, or other problems to blog posts about SQLCipher as we do not monitor them frequently. 18 | 19 | Copyright (c) 2010 Zetetic LLC 20 | All rights reserved. 21 | 22 | Redistribution and use in source and binary forms, with or without 23 | modification, are permitted provided that the following conditions are met: 24 | * Redistributions of source code must retain the above copyright 25 | notice, this list of conditions and the following disclaimer. 26 | * Redistributions in binary form must reproduce the above copyright 27 | notice, this list of conditions and the following disclaimer in the 28 | documentation and/or other materials provided with the distribution. 29 | * Neither the name of the ZETETIC LLC nor the 30 | names of its contributors may be used to endorse or promote products 31 | derived from this software without specific prior written permission. 32 | 33 | THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY 34 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 35 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 36 | DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY 37 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 38 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 42 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/android-support-v4.jar -------------------------------------------------------------------------------- /libs/android-support-v4.jar.properties: -------------------------------------------------------------------------------- 1 | src=android-support-v4.jar 2 | doc=/opt/android-sdk/docs/reference 3 | # The String value of 'doc' is handed straight to `new java.io.File()` so it 4 | # is not possible to use variables. Therefore, change "/opt/android-sdk" to 5 | # the path to your Android SDK, i.e. the value of $ANDROID_HOME or ${sdk.dir} 6 | # 7 | # Here's the relevant source: 8 | # https://android-review.googlesource.com/#/c/35702/3/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java 9 | -------------------------------------------------------------------------------- /libs/armeabi-v7a/libiocipher.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi-v7a/libiocipher.so -------------------------------------------------------------------------------- /libs/armeabi-v7a/libsqlcipher_android.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi-v7a/libsqlcipher_android.so -------------------------------------------------------------------------------- /libs/armeabi-v7a/libstlport_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi-v7a/libstlport_shared.so -------------------------------------------------------------------------------- /libs/armeabi-v7a/sqlfscat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi-v7a/sqlfscat -------------------------------------------------------------------------------- /libs/armeabi/libiocipher.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi/libiocipher.so -------------------------------------------------------------------------------- /libs/armeabi/libsqlcipher_android.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi/libsqlcipher_android.so -------------------------------------------------------------------------------- /libs/armeabi/libstlport_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi/libstlport_shared.so -------------------------------------------------------------------------------- /libs/armeabi/sqlfscat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/armeabi/sqlfscat -------------------------------------------------------------------------------- /libs/cachewordlib-v0.1-3-g71cc426-debug.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/cachewordlib-v0.1-3-g71cc426-debug.jar -------------------------------------------------------------------------------- /libs/jcodec.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/jcodec.jar -------------------------------------------------------------------------------- /libs/svg-android.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/svg-android.jar -------------------------------------------------------------------------------- /libs/x86/libiocipher.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/x86/libiocipher.so -------------------------------------------------------------------------------- /libs/x86/libsqlcipher_android.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/x86/libsqlcipher_android.so -------------------------------------------------------------------------------- /libs/x86/libstlport_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/x86/libstlport_shared.so -------------------------------------------------------------------------------- /libs/x86/sqlfscat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/libs/x86/sqlfscat -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | 12 | # Project target. 13 | target=android-19 14 | android.library=true 15 | -------------------------------------------------------------------------------- /res/drawable/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/audio.png -------------------------------------------------------------------------------- /res/drawable/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/folder.png -------------------------------------------------------------------------------- /res/drawable/ic_action_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/ic_action_camera.png -------------------------------------------------------------------------------- /res/drawable/ic_action_secure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/ic_action_secure.png -------------------------------------------------------------------------------- /res/drawable/ic_action_switch_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/ic_action_switch_camera.png -------------------------------------------------------------------------------- /res/drawable/ic_action_switch_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/ic_action_switch_video.png -------------------------------------------------------------------------------- /res/drawable/ic_action_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/ic_action_video.png -------------------------------------------------------------------------------- /res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable/jpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/jpeg.png -------------------------------------------------------------------------------- /res/drawable/mp4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/mp4.png -------------------------------------------------------------------------------- /res/drawable/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/splash.png -------------------------------------------------------------------------------- /res/drawable/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/text.png -------------------------------------------------------------------------------- /res/drawable/videoclip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardianproject/CamCipher/fedaa54cd5d59b127df95270d0842214df74cd70/res/drawable/videoclip.png -------------------------------------------------------------------------------- /res/layout-land/activity_gallery.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /res/layout-land/base_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 14 | 15 | 16 | 23 | 24 | 30 | 31 | 38 | 39 | 40 | 41 | 42 | 49 | 50 |