Skip to content

Big endian #101

@williamgoodhew

Description

@williamgoodhew

Is there a way of ensuring the big-endian network byte order is maintained? I am using the 128 key in ECB.

here is my current code:

    const key = Buffer.from("20572F52364B3F473050415811632D2B", "hex")
    const text = '0x060x010x010x01'
    const textBytes = aesjs.utils.utf8.toBytes(text);
    console.log('textBytes: ', textBytes)

    const aesEcb = new aesjs.ModeOfOperation.ecb(key);
    console.log('aesEcb: ', aesEcb)
    const encryptedBytes = aesEcb.encrypt(textBytes);
    console.log('encryptedBytes: ', encryptedBytes)

    const encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);
    console.log('encryptedHex: ', encryptedHex);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions