This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const crypto = require("crypto"); | |
| function generateECDHKeyPair() { | |
| const ecdh = crypto.createECDH("prime256v1"); | |
| const publicKey = ecdh.generateKeys(); | |
| return { ecdh, publicKey }; | |
| } | |
| function encryptWithAES(key, iv, plaintext) { | |
| const cipher = crypto.createCipheriv("aes-256-cbc", key, iv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as crypto from "crypto"; | |
| export function keyPair(): { publicKey: string; privateKey: string } { | |
| const a: bigint = 0n; | |
| const b: bigint = 7n; | |
| const p: bigint = 2n ** 256n - 2n ** 32n - 977n; | |
| const n: bigint = 115792089237316195423570985008687907852837564279074904382605163141518161494337n; | |
| const g = { | |
| x: 55066263022277343669578718895168534326250603453777594175500187360389116729240n, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const body = document.querySelector("body"); | |
| const video = document.querySelector("#video"); | |
| const playButton = document.querySelector("#play-button"); | |
| const playIcon = document.querySelector("#play-icon"); | |
| const configButton = document.querySelector("#config-button"); | |
| const configTempoButton = document.querySelector("#config-tempo-button"); | |
| const volumeInput = document.querySelector("#volume-input"); | |
| const watchProgress = document.querySelector("#watch-progress"); | |
| const currentTimeElement = document.querySelector("#current-time"); | |
| const durationTimeElement = document.querySelector("#duration-time"); |