Telchemy PCAP/MPEG2-TS Scrambling Application

Download Download

Release date:  24-February-2011
Release version: 2.0.001

This application scrambles and unscrambles live streams and offline PCAP files.

The following formats for live streaming are supported:

  • IP/UDP/MPEG2-TS
  • IP/UDP/RTP/MPEG2-TS.

In live streaming the scrambled and unscrambled streams are output to a specified IP address/port.

For scrambling PCAP files the following formats are supported:

  • IP/UDP/MPEG2-TS
  • IP/UDP/RTP/MPEG2-TS
  • IP/UDP/RTP

In case of MPEG2-TS the following scrambling-levels can be chosen:

  • PES-level scrambling, i.e. PES-headers are readable and only PES-payloads will be encrypted.
  • MPEG2-TS-level scrambling, i.e. MPEG2-TS headers are readable but MPEG2-TS payloads will be encrypted, which includes the PES-headers and payloads.

The scrambling algorithm currently uses a simple pseudo-random sequence/XOR, which may be sufficient to simulate a DRM application. In case the user provides a scrambling key of zero the payloads - as specified - will be zeroed.

This software is provided at no cost for experimental use in lab environments and Telchemy makes no warranty with regard to its operation or to any issues that may arise from its use.   Telchemy is not aware of any intellectual property issues that may result from the use of this software however makes no warranty with regard to patent infringement.  Telchemy has made no IPR claims with regard to this software with the exception of the requirements contained in this header.  The software may be modified, copied and made available to other parties however this header must be retained intact. The software may not be sold or incorporated into commercial applications.  Telchemy would appreciate any technical feedback and improvements - support@telchemy.com

System Requirements

  • written in standard ANSI 'C', the application is targeted for most C compilers (suggested compilers include gcc 3.3.x and gcc 4.x and derivatives)
  • dependencies: none

Using the application

The packet scrambling application can be used to operate in real time or to process trace files of MP2TS packets and IPv4 Ethernet packets in the Wireshark PCAP format as explained below.

Real time mode:
tscramble [-options] -src ip:port -dst ip:port -mlt ip:port

File based mode:
tscramble [-options] -i Infile -o Outfile

Where the required command line options are:

         -p: Pass through
         -s <key>: Scramble packet
         -d <key>: Unscramble packet
         -pes    : encrypt only the PES-payloads
         -mp2ts  : encrypt the entire MPEG2-TS payload
         -rtp    : encrypt the entire RTP payload

Real time mode

In this mode the application accepts a stream containing MP2TS packets over UDP or MP2TS packets over RTP over UDP. The application either scrambles or descrambles the stream and outputs the stream to an IP address/port provided via the command line. The scrambling/descrambling is performed using an algorithm which is based on the 'key' provide via the command line.

    -src ip:port   Describes the IP address and port of the local interface on which the MP2TS stream is received

    -dst ip:port   Describes the IP address and port of the remote host to which all the MP2TS packets are sent after processing

    -mlt ip:port   Describes the multicast session to join which will have the MP2TS stream. The packets are forwarded to the host described using the -dst option.
 
    Some examples:

    tscramble -p -src 192.168.1.15:30000 -dst 192.168.1.189:30001

    tscramble -s 1234 -src 192.168.1.15:30000 -dst 192.168.1.189:30001

    tscramble -d 1234 -src 192.168.1.189:30001 -dst 192.168.1.105:30002

    tscramble -s 1234 -mlt 239.255.1.3:20000 -dst 192.168.1.105:12345

File based mode

In this mode the application accepts a file containing MP2TS packets or Wireshark PCAP files containing MP2TS over UDP/RTP or just UDP recorded back to back. The application either scrambles or descrambles the packets and writes it to the output file provided via command line. The scrambling/descrambling is performed using an algorithm which is based on the 'key' provide via the command line. If the 'key' is zero the payloads will be set to zero.

    -i Infile     Input file with PCAP/MP2TS packet files
   
    -o Outfile    Output file with Scrambled/Un-scrambled packets while using the same output format as the input

Options:

    -s <key>      Scramble the PES packet payload using the 32-bit key provided as input; if the key is '0' the payloads will be set to zero

    -d <key>      Un-Scramble the PES packet payload using the 32-bit key provided as input
 
    -p            Do not scramble or unscramble packets; simply pass them on to the specified destination

    -pes          encrypt only the PES-payloads
    
    -mp2ts        encrypt the entire MPEG2-TS payload

    -rtp          encrypt the entire RTP payload

Some examples

    tscramble -s 1234 -i InputFile.ts -o ScrambledFile.ts

    tscramble -d 1234 -i ScrambledFile.ts -o UnscrambledFile.ts

    tscramble -s 0 -i InputFile.pcap -o ScrambledFile.pcap -pes

    tscramble -s 0 -i InputFile.pcap -o ScrambledFile.pcap -mp2ts

Reporting a Bug

To report a suspected bug, please contact Telchemy Product Support via phone, e-mail, or web at the following:

     Phone:     +1 866 TELCHEMY x300 (toll-free)
                       +1 678 387 3000 x300
     E-mail:    support@telchemy.com
     Web:       http://www.telchemy.com/support.html

Please have information such as your development or deployment environment details and software release number on hand.
 

Download Download