dcrypt.crypto.ciphers.RC6
Summary
Syntax
class RC6 : BlockCipher
Remarks
Implementation of the RC6-32/20/b cipher designed by Ron Rivest et al. of RSA Security. This algorithm is patented and trademarked.
Inherits from
Conforms to
None
Publically imports
None
References
Members
Fields
ENCRYPT
Syntax
public static const bool ENCRYPT
Remarks
Constant whose value is true. Intended to be passed to the init method of ciphers. (Inherited from Cipher.)
DECRYPT
Syntax
public static const bool DECRYPT
Remarks
Constant whose value is false. Intended to be passed to the init method of ciphers. (Inherited from Cipher.)
Properties
name
Syntax
public char[] name()
Remarks
The name of the cipher. (Inherited from Cipher.)
initialized
Syntax
public bool initialized()
Remarks
Whether or not the cipher has been initialized. (Inherited from Cipher.)
blockSize
Syntax
public uint blockSize()
Remarks
The block size in bytes of this block cipher. (Inherited from BlockCipher.)
Methods
init
Syntax
public void init(bool encrypt, CipherParameters params)
Remarks
Initialize a cipher. (Inherited from Cipher.)
reset
Syntax
public void reset()
Remarks
Reset a cipher. (Inherited from Cipher.)
update
Syntax
public uint update(void[] input_, void[] output_)
Remarks
Process a block of data from the input array and place it in the output array. Returns the amount of data processed in bytes. (Inherited from Cipher.)
Example
// dcrypt does NOT rely on Phobos or Tango import tango.io.Console; import dcrypt.misc.Util; import dcrypt.crypto.params.SymmetricKey; import dcrypt.crypto.ciphers.RC6; void main() { RC6 rc6 = new RC6; // Create a simple test vector ubyte[] testBytes = new ubyte[rc6.blockSize]; testBytes[] = 0x00; // Initialize the cipher and encrypt the test vector rc6.init(RC6.ENCRYPT, new SymmetricKey(testBytes)); rc6.update(testBytes, testBytes); Cout(Util.ubytesToHex(testBytes)); }