I would like to generate an encryption key from the build script and make the key an accessible variable from within my application.
I don't have very much shell scripting experience, and I'm looking for more examples similar to this:
http://aptogo.co.uk/2010/07/protecting-resources/
OR, if there are any current data protection frameworks that I am not aware of.
The intent is to add a layer of e n c r y p t i o n to my bundle resources. So that the media files are not accessible outside of the device.
Current script:
DIRNAME=CCResource
ENC_KEY="Generate and store key here and make available from within application"
INDIR=$PROJECT_DIR/$DIRNAME
OUTDIR=$TARGET_BUILD_DIR/$CONTENTS_FOLDER_PATH/$DIRNAME
if [ ! -d "$OUTDIR" ]; then
mkdir -p "$OUTDIR"
fi
for file in "$INDIR"/*
do
echo "Encrypting $file"
"$PROJECT_DIR/crypt" -e -k $ENC_KEY -i "$file" -o "$OUTDIR/`basename "$file"`"
done