des - v0.1.1
    Preparing search index...

    des - v0.1.1

    @li0ard/des
    DES cipher implementation in pure TypeScript
    docs




    # from NPM
    npm i @li0ard/des

    # from JSR
    bunx jsr i @li0ard/des
    • [x] Classic DES
    • [x] 3DES-EDE
    • [x] Electronic Codebook (ECB)
    • [x] Cipher Block Chaining (CBC)
    • [x] Cipher Feedback (CFB)
    • [x] Counter (CTR)
    • [x] Output Feedback (OFB)
    • [x] Retail MAC (ISO/IEC 9797-1 Algorithm 3)
    • Provides simple and modern API
    • Most of the APIs are strictly typed
    • Fully complies with FIPS 46-3 standard
    • Supports Bun, Node.js, Deno, Browsers
    import { decryptECB, encryptECB } from "@li0ard/des";

    const key = Buffer.from("1122334455667788", "hex");
    const plaintext = Buffer.from("11223344556677881122334455667788", "hex");
    const encrypted = encryptECB(key, plaintext);
    console.log(encrypted); // Uint8Array [ ... ]

    const decrypted = decryptECB(key, encrypted);
    console.log(decrypted); // Uint8Array [ ... ]
    import { decryptECB, encryptECB } from "@li0ard/des";

    const key = Buffer.from("1122334455667788...1122334455667788", "hex");
    const plaintext = Buffer.from("11223344556677881122334455667788", "hex");
    const encrypted = encryptECB(key, plaintext, true);
    console.log(encrypted); // Uint8Array [ ... ]

    const decrypted = decryptECB(key, encrypted, true);
    console.log(decrypted); // Uint8Array [ ... ]