Public
Edited
Jan 16, 2023
Insert cell
Insert cell
lib2 = import('https://cdn.skypack.dev/cryptopals-pcarleton@0.0.1?min')
Insert cell
CryptoJS = require('https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js')
Insert cell
import {lib} from "@pcarleton/cryptopals-helpers"
Insert cell
gen16byteKey = () => {
return CryptoJS.lib.WordArray.random(16)
}
Insert cell
gen16byteKey()
Insert cell
Math.floor(Math.random()*5) + 5
Insert cell
new Array(5).fill(0)
Insert cell
Insert cell
addRandomPadding("Hi there")
Insert cell
Insert cell
randomEncrypt = (plaintext) => {
const mode = (Math.random() > 0.5) ? "ecb" : "cbc";

const padded = addRandomPadding(plaintext);

const key = gen16byteKey();

if (mode == "ecb") {
return {mode, encrypted:
}
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more