From a7c9a1f8b63067144359e17ff3902ff5bb11476e Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Tue, 25 Aug 2026 07:53:45 -0700 Subject: [PATCH] Delete: Remove speck32_64ecb.js in favor of TS --- speck32_64ecb.js | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 speck32_64ecb.js diff --git a/speck32_64ecb.js b/speck32_64ecb.js deleted file mode 100644 index 0f5989c..0000000 --- a/speck32_64ecb.js +++ /dev/null @@ -1,25 +0,0 @@ -import speck from 'generic-speck'; -import { blake2bHex } from 'blakejs'; - -const speck32_64 = speck(); - -export function getKey(kStr) { - const key64bit = blake2bHex(kStr, null, 8); - return [ - parseInt(key64bit.slice(0, 4), 16), - parseInt(key64bit.slice(4, 8), 16), - parseInt(key64bit.slice(8, 12), 16), - parseInt(key64bit.slice(12, 16), 16) - ]; -} - -export function encrypt(ptStr, key) { - return Array.from(ptStr, c => speck32_64.encrypt(c.codePointAt(0), key)); -} - -export function decrypt(numArr, key) { - return numArr.map(x => { - try { return String.fromCodePoint(speck32_64.decrypt(x, key)); } - catch { return ''; } - }).join(''); -}