Skip to content

AES Encryption Overview

TVideoGrabber can:

  • encrypt a recording in real time to any video container (AVI, MP4, MKV, etc.),
  • play and seek the encrypted video with OpenPlayer, the decryption being performed in real time,
  • batch-encrypt a non-encrypted video clip to produce an encrypted video clip,
  • batch-decrypt an encrypted video clip to produce an unencrypted video clip.

Encryption methods

The method is the first parameter of SetEncryptionKey and SetDecryptionKey, see TEncryptionMethod:

  • em_AES_Encryption (recommended): AES-CTR, 128-bit key with a 16-character key value, 256-bit key with a 32-character key value.
  • em_Fast_Encryption: obfuscation only, not a secure encryption (the key can be deduced from the encrypted file). Kept to play and decrypt the files already encrypted with this method.

The encrypted files carry a Datastead header: Decrypt_File and the playback of a local clip use the method read from this header.

Requirements

Encryption and decryption require the optional Datastead RTSP/RTMP/HTTP/ONVIF Source and/or the Datastead Multipurpose Encoder. For AES encryption, use the Datastead RTSP/RTMP/HTTP/ONVIF Source 9.4.2.4 or above and the Datastead Multipurpose Encoder 3.2.9 or above:

  • with the previous versions, the real-time AES encryption is much slower,
  • the previous versions of the Datastead RTSP/RTMP/HTTP/ONVIF Source wrote the files batch-encrypted with em_AES_Encryption with the Fast method (obfuscation). These files remain readable: the method is read from the header of the file.

Activation

  • The encryption is activated by passing an encryption key to SetEncryptionKey.
  • The decryption is activated by passing the key used for the encryption to SetDecryptionKey.

Passing an empty key deactivates either feature.

The Datastead RTSP/RTMP/HTTP/ONVIF Source can:

  • encrypt in real time the recording of IP cameras or other URL sources in native format (without decompression/recompression), when SetEncryptionKey is invoked,
  • play and seek in real time, through the player features, any video previously encrypted. The decryption is enabled with SetDecryptionKey. The playback of an encrypted clip requires the Datastead RTSP/RTMP/HTTP/ONVIF Source; a clip that is not encrypted is played as usual, even when a decryption key is set,
  • batch-encrypt / decrypt video files with Encrypt_File / Decrypt_File, when the Datastead Multipurpose Encoder is not installed or cannot process the file.

The Datastead Multipurpose Encoder can:

  • encrypt in real time the audio/video source being recorded, except in the "recording of IP cameras and other URL sources in native format" case described above, which is handled directly by the Datastead RTSP/RTMP/HTTP/ONVIF Source,
  • batch-encrypt existing video files with Encrypt_File (used first when it is installed),
  • batch-decrypt encrypted video files with Decrypt_File (used first when it is installed).