Available parameters which you can use with security token

2017-11-28 16:34

If you have enabled protection using security token, you can define additional parameters to secure your content. The hash could be generated with the following options:

  • cdn_creation_time – when the hash was generated (unix timestamp)
  • cdn_ttl – the time for which the hash should be valid
  • cdn_net – IP from which the access will be allowed
  • cdn_bw – limit rate of the downloading speed
  • cdn_bw_fs - set the amount of data which should be served on full speed(support k,m and g for KB,MB and GB respectively)
  • cdn_cv_CUSTOM - this is custom parameter which can be configured based on your needs.(You should replace CUSTOM with any name)

With the above values, the hash that will need to be generated is:


for example:



  • /example/image.jpg – request.uri
  • VerySecureKey – your secret key
  • timestamp – creation time for the hash, you can use time() for php or website\ http://www.epochconverter.com/
  • 600 – time to live for generated hash
  • – the IP from which the URL can be accessed
  • 10240 – bytes per second limit rate
  • 10m - megabytes served at max speed
  • CUSTOM_PARAMETER - the value for the custom parameter

The full URL of the request will be:


You can use the following website to generate md5 hash for testing purposes:

Below you can find sample php code, for generating the required hash:


$secret_key = 'password';
$request_uri = '/path/to/video/videoname.mp4';

// Unix timestamp
$cdn_creation_time = time();

// how long the generated url will be active
$cdn_ttl = 600;

// limit access only to specified ip address or network
$cdn_net = "";

// or limit access only to specified /24 network
$cdn_net = "";

//limit download speed to
$cdn_bw = "10240" // bytes per second (10KB)

//the amount of served at maximum speed
$cdn_bw_fs = "10m" // 10 MB

//your custom parameter

$hash = md5($request_uri.$secret_key.$cdn_creation_time.$cdn_ttl.$cdn_net.$cdn_bw.$cdn_bw_fs.$cdn_cv_CUSTOM);

$access_url  = 'http://cname.clientdomain.com/'.$request_uri;
$access_url .= '?cdn_hash='.$hash.'&cdn_creation_time='.$cdn_creation_time;
$access_url .= '&cdn_ttl='.$cdn_ttl.'&cdn_net='.$cdn_net.'&cdn_bw='.$cdn_bw.'&cdn_bw_fs'.$cdn_bw_fs.'&cdn_cv_CUSTOM'.$cdn_cv_CUSTOM;

Tags: Additional parameters, Security token