SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media.transform.srtp
Class SRTPCipherCTR

java.lang.Object
  extended by net.java.sip.communicator.impl.media.transform.srtp.SRTPCipherCTR

public class SRTPCipherCTR
extends Object

SRTPCipherCTR implements SRTP Counter Mode AES Encryption (AES-CM). Counter Mode AES Encryption algorithm is defined in RFC3711, section 4.1.1. Other than Null Cipher, RFC3711 defined two two encryption algorithms: Counter Mode AES Encryption and F8 Mode AES encryption. Both encryption algorithms are capable to encrypt / decrypt arbitrary length data, and the size of packet data is not required to be a multiple of the AES block size (128bit). So, no padding is needed. Please note: these two encryption algorithms are specially defined by SRTP. They are not common AES encryption modes, so you will not be able to find a replacement implementation in common cryptographic libraries. As defined by RFC3711: Counter Mode Encryption is mandatory.. mandatory to impl optional default ------------------------------------------------------------------------- encryption AES-CM, NULL AES-f8 AES-CM message integrity HMAC-SHA1 - HMAC-SHA1 key derivation (PRF) AES-CM - AES-CM We use AESCipher to handle basic AES encryption / decryption.

Author:
Bing SU (nova.su@gmail.com)

Constructor Summary
SRTPCipherCTR()
           
 
Method Summary
 void getCipherStream(org.bouncycastle.crypto.engines.AESFastEngine aesCipher, byte[] out, int length, byte[] iv)
          Computes the cipher stream for AES CM mode.
 void process(org.bouncycastle.crypto.engines.AESFastEngine aesCipher, byte[] data, int off, int len, byte[] iv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SRTPCipherCTR

public SRTPCipherCTR()
Method Detail

process

public void process(org.bouncycastle.crypto.engines.AESFastEngine aesCipher,
                    byte[] data,
                    int off,
                    int len,
                    byte[] iv)

getCipherStream

public void getCipherStream(org.bouncycastle.crypto.engines.AESFastEngine aesCipher,
                            byte[] out,
                            int length,
                            byte[] iv)
Computes the cipher stream for AES CM mode. See section 4.1.1 in RFC3711 for detailed description.

Parameters:
out - byte array holding the output cipher stream
length - length of the cipher stream to produce, in bytes
iv - initialization vector used to generate this cipher stream

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.