Cipher
This represents a cipher object used to encrypt and decrypt media data files. Currently, only the AESCBC Cipher
is supported.
Used by actions play, receive fax, record, send fax and in HTTP Response
language wrappers and examples
AESCBC Cipher
Represents an Advanced Encryption Standard Cipher Block Chaining (AES CBC) cipher. The object properties are:
Property | Required/Optional | Description |
---|---|---|
type | required | Must be set to "aescbc". |
key | required | The cipher key as a string, either 128, 192 or 256 bits represented as 16, 24 or 32 hexadecimal bytes. |
initialisation vector | required | The initialisation vector as a string, 128 bits represented as 16 hexadecimal bytes. |
Examples:
{
"type" : "aescbc",
"key" : "431F43FAF57534C91F2DEB2E502A4C8CBA58AB5018BD1506419EEA86DF595D3A",
"initialisation_vector" : "F846443B9B85FAED9AB17570D5A82A31"
}
AesCbcCipher Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dll
A class that represents the Advanced Encryption Standard (AES) cipher in Cipher Block
Chaining (CBC) mode. The block size for this cipher is 128 bits.
public class AesCbcCipher : Cipher
{
// Constructors
public AesCbcCipher(byte[] key, byte[] initialisationVector);
// Members
public byte[] InitialisationVector;
}
Examples:
byte[] key = new byte[] {
0x1A, 0xA9, 0x38, 0x61, 0x29, 0x66, 0x2B, 0x3D,
0x80, 0x03, 0x74, 0x40, 0x71, 0x26, 0x32, 0xCA,
0x56, 0x49, 0x3C, 0x67, 0xD9, 0x56, 0xC1, 0x96,
0x58, 0x50, 0x0E, 0xC9, 0x0D, 0xBE, 0xCD, 0xD2 };
byte[] initialisationVector = new byte[] {
0x55, 0xB0, 0x5F, 0xF5, 0x9A, 0x28, 0xED, 0xAE,
0x0F, 0x2C, 0xDF, 0xCE, 0xBB, 0x99, 0xE3, 0x39 };
var aesCbcCipher = new AesCbcCipher(key, initialisationVector);
public class AesCbcCipher : Cipher
{
// Constructors
public AesCbcCipher(byte[] key, byte[] initialisationVector);
// Members
public byte[] InitialisationVector;
}
Examples:
byte[] key = new byte[] {
0x1A, 0xA9, 0x38, 0x61, 0x29, 0x66, 0x2B, 0x3D,
0x80, 0x03, 0x74, 0x40, 0x71, 0x26, 0x32, 0xCA,
0x56, 0x49, 0x3C, 0x67, 0xD9, 0x56, 0xC1, 0x96,
0x58, 0x50, 0x0E, 0xC9, 0x0D, 0xBE, 0xCD, 0xD2 };
byte[] initialisationVector = new byte[] {
0x55, 0xB0, 0x5F, 0xF5, 0x9A, 0x28, 0xED, 0xAE,
0x0F, 0x2C, 0xDF, 0xCE, 0xBB, 0x99, 0xE3, 0x39 };
var aesCbcCipher = new AesCbcCipher(key, initialisationVector);
public class AesCbcCipher : Cipher
{
// Constructors
public AesCbcCipher(byte[] key, byte[] initialisationVector);
// Members
public byte[] InitialisationVector;
}
Examples:
byte[] key = new byte[] {
0x1A, 0xA9, 0x38, 0x61, 0x29, 0x66, 0x2B, 0x3D,
0x80, 0x03, 0x74, 0x40, 0x71, 0x26, 0x32, 0xCA,
0x56, 0x49, 0x3C, 0x67, 0xD9, 0x56, 0xC1, 0x96,
0x58, 0x50, 0x0E, 0xC9, 0x0D, 0xBE, 0xCD, 0xD2 };
byte[] initialisationVector = new byte[] {
0x55, 0xB0, 0x5F, 0xF5, 0x9A, 0x28, 0xED, 0xAE,
0x0F, 0x2C, 0xDF, 0xCE, 0xBB, 0x99, 0xE3, 0x39 };
var aesCbcCipher = new AesCbcCipher(key, initialisationVector);
AesCbcCipher Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dll
A class that represents the Advanced Encryption Standard (AES) cipher in Cipher Block
Chaining (CBC) mode. The block size for this cipher is 128 bits.
Public Class AesCbcCipher
Inherits Cipher
' Constructors
Public Sub New (key As Byte(), initialisationVector As Byte())
' Members
Public Property InitialisationVector As Byte()
End Class
Examples:
Dim key As Byte() = { _
&H1A, &HA9, &H38, &H61, &H29, &H66, &H2B, &H3D, _
&H80, &H3, &H74, &H40, &H71, &H26, &H32, &HCA, _
&H56, &H49, &H3C, &H67, &HD9, &H56, &HC1, &H96, _
&H58, &H50, &HE, &HC9, &HD, &HBE, &HCD, &HD2}
Dim initialisationVector As Byte() = { _
&H55, &HB0, &H5F, &HF5, &H9A, &H28, &HED, &HAE, _
&HF, &H2C, &HDF, &HCE, &HBB, &H99, &HE3, &H39}
Dim AesCbcCipher = New AesCbcCipher(key, initialisationVector)
Public Class AesCbcCipher
Inherits Cipher
' Constructors
Public Sub New (key As Byte(), initialisationVector As Byte())
' Members
Public Property InitialisationVector As Byte()
End Class
Examples:
Dim key As Byte() = { _
&H1A, &HA9, &H38, &H61, &H29, &H66, &H2B, &H3D, _
&H80, &H3, &H74, &H40, &H71, &H26, &H32, &HCA, _
&H56, &H49, &H3C, &H67, &HD9, &H56, &HC1, &H96, _
&H58, &H50, &HE, &HC9, &HD, &HBE, &HCD, &HD2}
Dim initialisationVector As Byte() = { _
&H55, &HB0, &H5F, &HF5, &H9A, &H28, &HED, &HAE, _
&HF, &H2C, &HDF, &HCE, &HBB, &H99, &HE3, &H39}
Dim AesCbcCipher = New AesCbcCipher(key, initialisationVector)
class AesCbcCipher extends Cipher
Represents an AESCBC cipher to be used for file encryption/decryption.
Class synopsis:
// Constructors:
public AesCbcCipher(byte[] key, byte[] initialisationVector)
// Members:
public byte[] getInitialisationVector()
public void setInitialisationVector(byte[] initialisationVector)
Examples:
byte[] key = {
(byte)0x43, (byte)0x1F, (byte)0x43, (byte)0xFA, (byte)0xF5, (byte)0x75, (byte)0x34, (byte)0xC9,
(byte)0x1F, (byte)0x2D, (byte)0xEB, (byte)0x2E, (byte)0x50, (byte)0x2A, (byte)0x4C, (byte)0x8C,
(byte)0xBA, (byte)0x58, (byte)0xAB, (byte)0x50, (byte)0x18, (byte)0xBD, (byte)0x15, (byte)0x06,
(byte)0x41, (byte)0x9E, (byte)0xEA, (byte)0x86, (byte)0xDF, (byte)0x59, (byte)0x5D, (byte)0x3A };
byte[] iv = {
(byte)0xF8, (byte)0x46, (byte)0x44, (byte)0x3B, (byte)0x9B, (byte)0x85, (byte)0xFA, (byte)0xED,
(byte)0x9A, (byte)0xB1, (byte)0x75, (byte)0x70, (byte)0xD5, (byte)0xA8, (byte)0x2A, (byte)0x31 };
Cipher decryptionCipher = new AesCbcCipher(key, iv);
class AESCBCCipher
Represents an AESCBC cipher to be used for file encryption/decryption.
Class synopsis:
# AESCBCCipher object:
AESCBCCipher(key, initialisation_vector)
Examples:
aescbc_cipher = AESCBCCipher(key='419EEA86DF595D3A431F43FAF57534C91F2DEB2E502A4C8CBA58AB5018BD1506',
initialisation_vector='D5A82A31F846443B9B85FAED9AB17570')
The AesCbcCipher class
Introduction
A class to represent a cipher using AES in CBC mode.
Class synopsis
class AesCbcCipher extends Cipher {
/* methods */
public __construct(string $key, string $initialisation_vector)
}
Examples:
$cipher = new AesCbcCipher(
"431F43FAF57534C91F2DEB2E502A4C8CBA58AB5018BD1506419EEA86DF595D3A",
"F846443B9B85FAED9AB17570D5A82A31"
);