13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Storing local data<br />

Note: In addition to the <strong>en</strong>crypted local store, AIR also provides <strong>en</strong>cryption for cont<strong>en</strong>t stored in SQL databases. For<br />

details, see “Using <strong>en</strong>cryption with SQL databases” on page 757.<br />

You may want to use the <strong>en</strong>crypted local store to cache information that must be secured, such as login cred<strong>en</strong>tials for<br />

web services. The ELS is appropriate for storing information that must be kept private from other users. It does not,<br />

however, protect the data from other processes run under the same user account. It is thus not appropriate for<br />

protecting secret application data, such as DRM or <strong>en</strong>cryption keys.<br />

On desktop platforms, AIR uses DPAPI on Windows, KeyChain on Mac OS and iOS, and KeyRing or KWallet on<br />

Linux to associate the <strong>en</strong>crypted local store to each application and user. The <strong>en</strong>crypted local store uses AES-CBC 128bit<br />

<strong>en</strong>cryption.<br />

On Android, the data stored by the EncryptedLocalStorage class are not <strong>en</strong>crypted. Instead the data is protected by the<br />

user-level security provided by the operating system. The Android operating system assigns every application a<br />

separate user ID. Applications can only access their own files and files created in public locations (such as the<br />

removable storage card). Note that on “rooted” Android devices, applications running with root privileges CAN access<br />

the files of other applications. Thus on a rooted device, the <strong>en</strong>crypted local store does not provide as high a level of data<br />

protection as it does on on a non-rooted device.<br />

Information in the <strong>en</strong>crypted local store is only available to AIR application cont<strong>en</strong>t in the application security<br />

sandbox.<br />

If you update an AIR application, the updated version retains access to any existing data in the <strong>en</strong>crypted local store<br />

unless:<br />

The items were added with the stronglyBound parameter set to true<br />

The existing and update versions are both published prior to AIR 1.5.3 and the update is signed with a migration<br />

signature.<br />

Limitations of the <strong>en</strong>crypted local store<br />

The data in the <strong>en</strong>crypted local store is protected by the user’s operating system account cred<strong>en</strong>tials. Other <strong>en</strong>tities<br />

cannot access the data in the store unless they can login as that user. However, the data is not secure against access by<br />

other applications run by an auth<strong>en</strong>ticated user.<br />

Because the user must be auth<strong>en</strong>ticated for these attacks to work, the user’s private data is still protected (unless the<br />

user account itself is compromised). However, data that your application may want to keep secret from users, such as<br />

keys used for lic<strong>en</strong>sing or digital rights managem<strong>en</strong>t, is not secure. Thus the ELS is not an appropriate location for<br />

storing such information. It is only an appropriate place for storing a user’s private data, such as passwords.<br />

Data in the ELS can be lost for a variety of reasons. For example, the user could uninstall the application and delete the<br />

<strong>en</strong>crypted file. Or, the publisher ID could be changed as a result of an update. Thus the ELS should be treated as a<br />

private cache, not a perman<strong>en</strong>t data storage.<br />

The stronglyBound parameter is deprecated and should not be set to true. Setting the parameter to true does not<br />

provide any additional protection for data. At the same time, access to the data is lost wh<strong>en</strong>ever the application is<br />

updated — ev<strong>en</strong> if the publisher ID stays the same.<br />

The <strong>en</strong>crypted local store may perform more slowly if the stored data exceeds 10MB.<br />

Wh<strong>en</strong> you uninstall an AIR application, the uninstaller does not delete data stored in the <strong>en</strong>crypted local store.<br />

The best practices for using the ELS include:<br />

Use the ELS to store s<strong>en</strong>sitive user data such as passwords (setting stronglyBound to false)<br />

Do not use the ELS to store applications secrets such as DRM keys or lic<strong>en</strong>sing tok<strong>en</strong>s.<br />

Last updated 6/6/2012<br />

710

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!