現在、Level3 CDN からの rtmp ストリームのセキュリティ保護に取り組んでいます。
ドキュメントは次の場所にあります: https://rapidshare.com/files/1450549534/Token_Components.html (表示するにはログインする必要があるようです。したがって、私は RapidShare でホストされています。元の URL は次のとおりです: https:// mediaportal.level3.com/mediaWeb/help/Content/ServicesDocs-Streaming/StreamingTokenAuth/TokenComponents.htm )
オンデマンド ストリーミングの入出力の例 (MP4 ファイルの場合)にスクロールします。
例を再現し、同じ値で同じ URL を取得しようとしています。そのための小さな関数を書きました:
function flimmithash($file) {
$streamer = 'pmsales';
$host = 'pmsalesfs.fplive.net';
$start_time = '20080101120000';
$end_time = '20101231235900';
$customer_secret = 'Secret'; // in the documentation there is also secret with a non capital s, i tried both
$resouce_path = "/$streamer/$file"; echo "resouce_path: $resouce_path <br>\n";
$message = "$resouce_path?start_time=$start_time&end_time=$end_time#$customer_secret"; echo "message: $message <br>\n";
$digest = md5($message); echo "digest: $digest <br>\n";
$tokenvalue = "start_time=$start_time&end_time=$end_time&digest=$digest"; echo "tokenvalue: $tokenvalue <br>\n";
$token = base64_encode($tokenvalue); echo "token: $token <br>\n";
$url = "rtmp://$host/$streamer?token=".($token)."/mp4:$file"; echo "url: $url <br>\n";
return $url;
}
echo "url: ".flimmithash('support/lvlt300kbps.mp4')."<br>\n";
例とまったく同じ値を使用していますが、同じダイジェストを取得できません。
長さが合うのでmd5を使いました。私はまた、大文字と非大文字の s で secret を試しました。
ここでサンプル スクリプトにアクセスできます: https://rapidshare.com/files/2581196874/Appendix.html (オリジナル: https://mediaportal.level3.com/mediaWeb/help/Content/ServicesDocs-Streaming/StreamingTokenAuth/Appendix- SampleScripts.htm )
しかし、md5 はまったく使用されておらず、sha1 が使用されています。ただし、sha1 は例のダイジェストよりも長くなっています。
もちろん、両方のバージョンに値を入力しようとしましたが、どちらも機能しませんでした。
私の質問は次のとおりです。誰かが例を再現したり、ダイジェストを教えたり、例に従って動作するように機能を変更したりできますか?