public static function decrypt(data:ByteArray, key:ByteArray, iv:ByteArray):ByteArray
Language version: | ActionScript 3.0 |
A utility function for decrypting an arbitrary amount of data.
The decryption uses AES CBC encryption with a key that can be
16, 24 or 32 bytes long (128, 192 or 256 bits). The IV must be
16 bytes long and the data must be a multiple of 16 bytes.
Note that to decrypt properly, the same key and IV should be used
as when the data was encrypted.
Parameters
| data:ByteArray — A ByteArray object containing the data to decrypt.
|
|
| key:ByteArray — A ByteArray object containing the key that was used in the encryption.
|
|
| iv:ByteArray — A ByteArray object containing the initialization vector to use.
|
Returns
Throws
| ArgumentError — If any of the parameters do not meet their required constraints.
|
public static function encrypt(data:ByteArray, key:ByteArray, iv:ByteArray):ByteArray
Language version: | ActionScript 3.0 |
A utility function for encrypting an arbitrary amount of data.
The encryption uses AES CBC encryption with a key that can be
16, 24 or 32 bytes long (128, 192 or 256 bits). The IV must be
16 bytes long and the data must be a multiple of 16 bytes.
Parameters
| data:ByteArray — A ByteArray object containing the data to encrypt.
|
|
| key:ByteArray — A ByteArray object containing the key to use in the encryption.
|
|
| iv:ByteArray — A ByteArray object containing the initialization vector to use.
|
Returns
Throws
| ArgumentError — If any of the parameters do not meet their required constraints.
|
public static function getRandomBytes(size:uint):ByteArray
Language version: | ActionScript 3.0 |
A utility function for generating random data.
Parameters
| size:uint — Number of bytes to generate.
|
Returns
| ByteArray —
A ByteArray object containing random data.
|