Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5195] iOS: encyption of local data in an application

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsiOS
Labelscb-tooling
ReporterJon Alter
AssigneeChris Barber
Created2011-09-01T20:28:10.000+0000
Updated2016-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();

Associated Helpdesk Tickets

http://appc.me/c/MUJ-49921-948 http://appc.me/c/APP-134761

Comments

No comments

JSON Source