Skip to content

Node crypto / tiny AES round trip not working for 192/256 bit keys #237

@petef19

Description

@petef19

I have created AES CBC ciphers via Node crypto w/ 16 byte keys - tiny AES decrypts the cipher correctly.
Ciphers created in Node crypto AES CBC using 24 byte or 32 bytes are NOT correctly decrypted in tiny AES, the derived padding is incorrect and the padding value is > 16...

is this a known limitation of the lib?

for context:
1 - I believe Node crypto is using OpenSSL.
2 - a Node crypto AES CBC round trip using 16/24/32 byte keys works
3 - a tiny AES round AES CBC trip using 16/24/32 byte keys works
4 - Node<->tiny 16 byte key AES CBC round trip works
5 - Node<->tiny 24|32 byte key AES CBC round trip does NOT work

example - AES CBC 192 bit:

std::string c_b64 = "6l9sPiHYKjK6LiIkJ7qcIg==";   // b64 cipher from Node crypto
std::string aek = "0.591.075170084239850551";  // AES key, 24 bytes
std::string iv = "0123456789abcdef";  // IV

tiny AES decrypting will NOT work but works in Node crypto

example - AES CBC 128bit:

std::string c_b64 = "0B/7mia9ITdfg4QG4AqL/w==";   // b64 cipher from Node crypto
std::string aek = "0.591.0751700842";  // AES key, 16 bytes
std::string iv = "0123456789abcdef";  // IV

tiny AES decrypting will work

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