Skip to content

🐛 Cipher behaviour change from 0.7+ to 1+ #945

@vic614

Description

@vic614

What's happening?

I observed a Cipher behaviour change with AES-256-CBC when doing string vs buffer concat.

Reproducible Code

const key= 'KTnGEDonslhj/qGvf6rj4HSnO32T7dvjAs5PntTDB0s=';
const ivv = '2pXx2krk1wU8RI6AQjuPUg==';
const alg = "AES-256-CBC";
const text = "this is a test."

//Buffer concat
const cipher = QuickCrypto.createCipheriv(alg, Buffer.from(key, "base64"), Buffer.from(ivv, "base64"));
const encrypted_text = Buffer.concat([cipher.update(Buffer.from(text, "utf8")), cipher.final()]).toString('base64');

//String concat
const enc_text = cipher.update(text, 'utf8', 'base64') + cipher.final('base64');

console.log(encrypted_text)
console.log(enc_text)

//I believe, in the 0.7+ version they are supposed to be the same. Not sure where the issue could be.

Relevant log output

LOG  YlQjRMA/8ne7O7zAe0nzJQ==
 LOG  tRlNnctKub5l7FDV9dD6Wg==

Device

ios 26.2

QuickCrypto Version

1.0.10

Can you reproduce this issue in the QuickCrypto Example app?

Yes, I can reproduce the same issue in the Example app here

Additional information

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions