npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sora-e2ee

v2020.3.0

Published

WebRTC SFU Sora JavaScript E2EE Library

Downloads

10

Readme

Sora JS E2EE ライブラリ

GitHub tag npm version License

時雨堂のオープンソースソフトウェアについて

利用前に https://github.com/shiguredo/oss をお読みください。

概要

WebRTC SFU Sora 利用時に E2EE をブラウザで実現するためのライブラリです。 これ単体では利用できず Sora JS SDK と合わせて利用します。

Q&A

  • このライブラリのライセンスはなんですか?
    • Apache License 2.0 です
  • E2EE を利用するメリットはなんですか?
    • WebRTC SFU 側で音声や映像の解析が困難になります
  • E2EE 用の鍵はどうやって生成すればいいですか?
    • E2EE 用の鍵についてはこのライブラリではただの文字列としてしか扱いません
  • E2EE に利用する暗号方式は何を採用していますか?
    • AES-GCM 128 を採用しています
  • E2EE に利用する暗号鍵を生成する鍵導出関数はなんですか?
    • PBKDF2 を利用します
  • E2EE に利用する IV の生成方法はなんですか?
    • PBKDF2 の Salt に SSRC を利用して生成された 96 ビットの値と前半 64 ビットを 0 パディングした 32 ビットのシーケンス番号の XOR を利用します
  • E2EE 用の鍵はどうやって利用しますか?
    • Sora JS SDK のオプションに {e2ee: "key"} として渡します
  • E2EE 用の鍵は Sora に送られますか?
    • 送られません Sora には {e2ee: true} という値のみが送られます
    • この値は E2EE を利用しているかどうかを把握するために利用されます
  • E2EE で利用する暗号鍵の利用回数が 2^32-1 回を超えたらどうなりますか?
    • 鍵の更新は行わず切断します
  • E2EE はどうやって実現していますか?
    • Insertable Streams API を利用して実現しています
  • E2EE を利用すると遅くなりますか?
    • 暗号化/復号が入るので遅くはなりますが WebWorker を利用することで可能な範囲で高速化はしています
  • 暗号ライブラリは何を利用していますか?
    • WebCrypto を利用しています
  • MasterSecret の共有方法は対応していますか?
    • 現時点では対応していません
  • 定期的な鍵交換には対応していますか?
    • 現時点では対応していません
  • Secure Frame には対応しますか?
    • 対応予定です

利用可能環境

  • Chrome M83 以降
  • Insertable Streams API が Chrome M83-85 で Origin Trial 中

利用技術

Sora JavaScript SDK からの利用方法

let sora = Sora.connection('wss://sora-labo.shiguredo.jp/signaling');
let channelId = 'shiguredo@sora-labo';
let metadata = {'signaling_key': 'VBmHJ75tjP_NPpHPDwDHfuf84LtNtOx0-ElOZ0qlU7xQ0QtV'};
let sendrecv = sora.sendrecv(channelId, metadata, {e2ee: 'e2ee-secret-key'});

navigator.mediaDevices.getUserMedia({audio: true, video: true})
  .then(mediaStream => {
    // connect
    sendrecv.connect(mediaStream)
      .then(stream => {
        // stream を video.src に追加する等の処理
      });
  })
  .catch(e => {
    console.error(e);
  });

// disconnect
sendrecv.disconnect()
  .then(() => {
    // video を止める等の処理
  });

// event
sendrecv.on('disconnect', function(e) {
  console.error(e);
});

現在 Sora Labo でサンプルが利用可能です

Sora Labo のダッシュボードの E2EE マルチストリーム送受信 を触ってみてください。

ライセンス

Copyright 2020, Shiguredo Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.