Array

Using Encrypted Local Storage

Must Read

Admin
Admin
Just post!

AIR has an encryption functionality which you can use to store sensitive data. The data is encrypted using AES-CBC 128-bit. Although this capability is not available for Android at the time of this writing, it is worth discussing in case it is added in the future.

The EncryptedLocalStorage static class belongs to the flash.data package and inherits from Object. The data is application-specific and can only be retrieved from within its security sandbox. It is saved as a ByteArray and requires a key.

To encrypt the data, use:

encrypt the data, use:
import flash.utils.ByteArray;
import flash.data.EncryptedLocalStore;
function write():void {
var myData:ByteArray = new ByteArray();
myData.writeUTFBytes(“my very sensitive data”);
EncryptedLocalStore.setItem(“myKey”, myData);
}
To decrypt the data, use:
function read():void {
var myData:ByteArray = EncryptedLocalStore.getItem(“myKey”);
if (myData != null) {
trace(myData.readUTFBytes(myData.bytesAvailable);
}
}
To remove the data, use:
function delete():void {
EncryptedLocalStore.removeItem(“myKey”);
}

 

- Advertisement -

Latest News

Neta Auto launches tech brand “Hozon Intelligent Technology” to lead further development of intelligent EVs

On November 21, Neta Auto held a press conference in Shanghai to unveil its global technology brand "Hozon Intelligent...
- Advertisement -

More Articles Like This

- Advertisement -