# How to hash the correct url to playback the vod MPEG-DASH file?

**URL:** https://community.wowza.com/t/how-to-hash-the-correct-url-to-playback-the-vod-mpeg-dash-file/44277
**Category:** Hire a Consultant
**Created:** [November 23, 2014, 10:31pm UTC](https://community.wowza.com/t/how-to-hash-the-correct-url-to-playback-the-vod-mpeg-dash-file/44277 "2014-11-23T22:31:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tim\_Tsai](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Tim\_Tsai](https://community.wowza.com/u/Tim_Tsai)
#### Post date: [November 23, 2014, 10:31pm UTC](https://community.wowza.com/t/how-to-hash-the-correct-url-to-playback-the-vod-mpeg-dash-file/44277/1 "2014-11-23T22:31:25Z")

</div>

I install a wowza server on server A, and I can playback the vod video on computer B.

But after I set the Outgoing Security.

I can’t playback any more, I have already read and try this article ([https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine](https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine)).

But it’s not working.

my setting:

SecureToken

Protect all protocols using hash (SecureToken version 2)

Shared Secret

adcd

Hash Algorithm

SHA-256

Use TEA for RTMP token security: false

Include client IP address in hash generation: false

Hash Query Parameter Prefix

wowzatoken

Client Restrictions

Not enabled

Place give me some help. Thanks!

---

<div class="post-metadata">

### Author: ![Tim\_Tsai](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Tim\_Tsai](https://community.wowza.com/u/Tim_Tsai)
#### Post date: [November 24, 2014, 6:25pm UTC](https://community.wowza.com/t/how-to-hash-the-correct-url-to-playback-the-vod-mpeg-dash-file/44277/2 "2014-11-24T18:25:33Z")

</div>

I’m so junior.

Is there anyone can help me?

---

<div class="post-metadata">

### Author: ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)
#### Post date: [November 25, 2014, 9:37am UTC](https://community.wowza.com/t/how-to-hash-the-correct-url-to-playback-the-vod-mpeg-dash-file/44277/3 "2014-11-25T09:37:57Z")

</div>

There are numerous examples on the Net about how to hash a string with SHA256 in C#. You can eg. try this code (not tested though)

```auto
var password = "123456";
var application = "live";
var streamname = "myStream";
var text = application + "/" + streamname + "?" + password;
var bytes = System.Text.Encoding.UTF8.GetBytes(text);
var sha256 = new System.Security.Cryptography.SHA256Managed();
var hash = sha256.ComputeHash(bytes);
var token = Convert.ToBase64String(hash);
token = token.Replace('+', '-');
token = token.Replace('/', '_');
var url = "http://server:1935/" + application + "/" + streamname + "?wowzatokenhash=" + token;

```
