[TIMOB-5195] iOS: encyption of local data in an application
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 1.7.2 |
Fix Version/s | n/a |
Components | iOS |
Labels | cb-tooling |
Reporter | Jon Alter |
Assignee | Chris Barber |
Created | 2011-09-01T20:28:10.000+0000 |
Updated | 2016-08-19T23:32:24.000+0000 |
Description
Requesting the ability to encrypt local data in an application.
The ability to programmatically encrypt a file or folder that is accessible via Filesystem in the app, including but not limited to large files such as videos etc. The ability to encrypt certain files and not others.
The encryption shall include, but not be limited to when the device is locked.
Its purpose is protect against theft of digital property that is inside of or written by the app. This theft/attack can come in the form of approved tools or by accessing the filesystem of the device via unapproved methods. If a file is encrypted it shall be encrypted when accessed by any of the aforementioned means.
Example for testing
The example app blow is intended to be used as part of the testing to be performed when this feature is being accepted. Some changes will need to be made to the code depending on how this feature is implemented.
var win = Ti.UI.createWindow({
backgroundColor: 'blue',
layout: 'vertical'
});
var testFile;
var label = Ti.UI.createLabel({
top: 10,
height: 100,
width: 300,
backgroundColor: "green",
text: "Read the text file already!"
});
win.add(label);
var tfield = Ti.UI.createTextField({
top: 10,
height: 40,
width: 200,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
value: "text written via write()"
});
tfield.addEventListener('return', function(e){
tfield.blur();
});
win.addEventListener('click', function(e){
tfield.blur();
});
win.add(tfield);
var createButton = Ti.UI.createButton({
top: 20,
height: 50,
width: 200,
title: "Create File"
});
createButton.addEventListener('click', function(e){
testFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.txt');
});
win.add(createButton);
var writeButton = Ti.UI.createButton({
top: 20,
height: 50,
width: 200,
title: "Write File"
});
writeButton.addEventListener('click', function(e){
Ti.API.info('text.txt exists? ' + testFile.exists());
Ti.API.info('text.txt size: ' + testFile.size + ' bytes');
if(!testFile.write(tfield.value)) {
Ti.API.info("could not write string to file.");
}
});
win.add(writeButton);
var readButton = Ti.UI.createButton({
top: 20,
height: 50,
width: 200,
title: "Read File"
});
readButton.addEventListener('click', function(e){
Ti.API.info('text.txt exists? ' + testFile.exists());
Ti.API.info('text.txt size: ' + testFile.size + ' bytes');
var text = testFile.read().text;
Ti.API.info('#### Text of testFile: ['+text+']');
label.text = text;
});
win.add(readButton);
var deleteButton = Ti.UI.createButton({
top: 20,
height: 50,
width: 200,
title: "Delete File"
});
deleteButton.addEventListener('click', function(e){
testFile.deleteFile();
});
win.add(deleteButton);
win.open();
No comments