Skip to content

Instantly share code, notes, and snippets.

View immclarenbaby's full-sized avatar
🎯
Focusing

mclaren immclarenbaby

🎯
Focusing
View GitHub Profile
@immclarenbaby
immclarenbaby / node-forge-ecc.ts
Last active April 7, 2024 20:42
feat: completly changed it because it didnt work
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);
@immclarenbaby
immclarenbaby / ecc.ts
Last active April 7, 2024 20:20
feat: cipher and decipher with xor algorithm
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,
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");