BlockCodec

Description

abstract class Tinman.Core.Codec.BlockCodec

Derived from

IBlockCodec

Abstract base class for IBlockCodec implementations.

Public / Methods

AES


public static method AES → (2)

mode in : CodecMode

Encode or decode?

keyData in : int8 [ ]

[not-null]
Bytes of the cipher key. Must be 128, 192 or 256 bits in length.

returns → IBlockCodec

The created IBlockCodec instance.

Creates a new instance of IBlockCodec that implements the symmetric cipher AES.

RSA


public static method RSA → (3)

mode in : CodecMode

Encode or decode?

modulus in : int32 [ ]

[not-null]
The shared modulus N of the key.

exponent opt : int32 [ ] = null

The exponent (e or d, depending on IBlockCodec.Mode) of the key. If null, the value 65537 will be used.

returns → IBlockCodec

The created IBlockCodec instance.

Creates a new instance of IBlockCodec that implements the asymmetric cipher RSA.

Separate keys are used for encoding and decoding:

(e, N)
(d, N)

where e is the encoding exponent, d is the decoding exponent and N is the shared modulus. A plaintext message m (i.e. a single input block, interpreted as a big integer value) is encrypted into ciphertext c using this formula:

c = m^e % N
m = c^d % N

Big integer values are specified as arrays of 32-bit integers, in big-endian order.