Honestly way too much went into this single commit. I am so sorry future me

This commit is contained in:
Emma
2023-06-09 00:54:00 -06:00
parent cd3f653f3f
commit 42c0004150
67 changed files with 4617 additions and 92 deletions

23
lib/gsEncryption/index.ts Normal file
View File

@@ -0,0 +1,23 @@
import {Aes} from "https://deno.land/x/crypto@v0.10.0/aes.ts";
import {Cbc, Padding} from "https://deno.land/x/crypto@v0.10.0/block-modes.ts";
const te = new TextEncoder();
const key = te.encode("EmmaHasHugeTitts");
const data = te.encode("DataToBeEncrypted");
const iv = new Uint8Array(16);
const cipher = new Cbc(Aes, key, iv, Padding.PKCS7)
const decipher = new Cbc(Aes, key, iv, Padding.PKCS7)
const encrypted = cipher.encrypt(data);
const decrypted = decipher.decrypt(encrypted);
console.decode = function (encoded: Uint8Array) {
const td = new TextDecoder();
this.log(td.decode(encoded));
}
console.decode(data);
console.decode(encrypted);
console.decode(decrypted);