ActionScript 3 Cryptography Library | All Packages | All Classes | Index | Frames No Frames |
Crypto

Package | com.hurlant.crypto
Class | public class Crypto
Inheritance | Crypto Object

A class to make it easy to use the rest of the framework. As a side-effect, using this class will cause most of the framework to be linked into your application, which is not always what you want. If you want to optimize your download size, don't use this class. (But feel free to read it to get ideas on how to get the algorithm you want.)

Public Methods

| Method | Defined By
--- | --- | ---
|  | Crypto() | Crypto
|  | getCipher(name:String, key:ByteArray, pad:IPad = null):ICipher [static] Things that should work, among others: "aes" "aes-128-ecb" "aes-128-cbc" "aes-128-cfb" "aes-128-cfb8" "aes-128-ofb" "aes-192-cfb" "aes-256-ofb" "blowfish-cbc" "des-ecb" "xtea" "xtea-ecb" "xtea-cbc" "xtea-cfb" "xtea-cfb8" "xtea-ofb" "rc4" "simple-aes-cbc" | Crypto
|  | getHash(name:String):IHash [static] Things that should work: "md5" "sha" "sha1" "sha224" "sha256" | Crypto
|  | getHMAC(name:String):HMAC [static] Things that should work: "sha1" "md5-64" "hmac-md5-96" "hmac-sha1-128" "hmac-sha256-192" etc. | Crypto
|  | getKeySize(name:String):uint [static] Returns the size of a key for a given cipher identifier. | Crypto
|  | getMAC(name:String):MAC [static] | Crypto
|  | getPad(name:String):IPad [static] | Crypto
|  | getRSA(E:String, M:String):RSAKey [static] mostly useless. | Crypto

Constructor Detail

Crypto | () | Constructor

`public function Crypto()`

Method Detail

getCipher | () | method

`public static function getCipher(name:String, key:ByteArray, pad:IPad = null):ICipher`

Things that should work, among others: "aes" "aes-128-ecb" "aes-128-cbc" "aes-128-cfb" "aes-128-cfb8" "aes-128-ofb" "aes-192-cfb" "aes-256-ofb" "blowfish-cbc" "des-ecb" "xtea" "xtea-ecb" "xtea-cbc" "xtea-cfb" "xtea-cfb8" "xtea-ofb" "rc4" "simple-aes-cbc"

Parameters

| `name:String`
| `key:ByteArray`
| `pad:IPad` (default = `null`)``

Returns

| `ICipher`

getHash | () | method |

`public static function getHash(name:String):IHash`

Things that should work: "md5" "sha" "sha1" "sha224" "sha256"

Parameters

| `name:String`

Returns

| `IHash`

getHMAC | () | method |

`public static function getHMAC(name:String):HMAC`

Things that should work: "sha1" "md5-64" "hmac-md5-96" "hmac-sha1-128" "hmac-sha256-192" etc.

Parameters

| `name:String`

Returns

| `HMAC`

getKeySize | () | method |

`public static function getKeySize(name:String):uint`

Returns the size of a key for a given cipher identifier.

Parameters

| `name:String`

Returns

| `uint`

getMAC | () | method |

`public static function getMAC(name:String):MAC`

Parameters

| `name:String`

Returns

| `MAC`

getPad | () | method |

`public static function getPad(name:String):IPad`

Parameters

| `name:String`

Returns

| `IPad`

getRSA | () | method |

`public static function getRSA(E:String, M:String):RSAKey`

mostly useless.

Parameters

| `E:String`
| `M:String`

Returns

| `RSAKey`

Mon May 20 2013, 09:16 PM +02:00