| Package | calista.hash |
| Class | public class RXOR |
| Inheritance | RXOR Object |
Example :
import calista.hash.RXOR ;
var rxor:RXOR = new RXOR() ;
var cipher:String ;
var source:String ;
cipher = rxor.encrypt( "hello world" , 0x1234 ) ;
trace( cipher ) ; // ቜ⌤㑾䅏ቛ⍡㑥䅌ቆ⌭㑶
source = rxor.encrypt( cipher , 0x1234 ) ;
trace( source ) ; // hello world
See more information about XOR encryption : http://www.acm.org/crossroads/xrds11-3/xorencrypt.html
| Method | Defined By | ||
|---|---|---|---|
RXOR()
Creates a new RXOR instance. | RXOR | ||
encrypt(source:String, key:uint = 0x1234):String
Encrypt the specified text with the passed-in key. | RXOR | ||
encrypt(source:String, key:uint = 0x1234):String [static]
Encrypt the specified text with the passed-in key. | RXOR | ||
rotbit(key:uint):uint
Rotates the bits of the key by block of 4bits (eg. | RXOR | ||
| RXOR | () | Constructor |
public function RXOR()Creates a new RXOR instance.
| encrypt | () | method |
public function encrypt(source:String, key:uint = 0x1234):StringEncrypt the specified text with the passed-in key. Note : we force the key to be 16bit (0xffff) so the hex can be converted to unicode
Parameters
source:String — The source to encrypt.
| |
key:uint (default = 0x1234) — The key used to encrypt.
|
String |
| encrypt | () | method |
public static function encrypt(source:String, key:uint = 0x1234):StringEncrypt the specified text with the passed-in key. Note : we force the key to be 16bit (0xffff) so the hex can be converted to unicode
Example :
import calista.hash.RXOR ;
var cipher:String ;
var source:String ;
cipher = RXOR.encrypt( "hello world" , 0x1234 ) ;
trace( cipher ) ; // ቜ⌤㑾䅏ቛ⍡㑥䅌ቆ⌭㑶
source = RXOR.encrypt( cipher , 0x1234 ) ;
trace( source ) ; // hello world
Parameters
source:String — The source to encrypt.
| |
key:uint (default = 0x1234) — The key used to encrypt.
|
String |
| rotbit | () | method |
public function rotbit(key:uint):uintRotates the bits of the key by block of 4bits (eg. 0xF). for ex: if your input is 0x1234 it returns 0x2341
Parameters
key:uint |
uint — the rotated bits
|