browserify / browserify/crypto-browserify

Special characters in encryption key - different output

Open
#209 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
681
Forks
209
PR merge metrics
No merged PRs in 30d

Description

Using special language native characters in encryption key result in different crypted phrase compared to native crypto node module.
Example of characters: ěščřžýáíéśćżź and way more.

Reproduction code:

```
const crypto = require("crypto");
const cryptoBrowser = require("crypto-browserify");
const algorithm = "aes-256-ctr";
const encryptionkey = "asdasdasdsadś gqwfwqrn";

const encrypt = crypto.createCipher(algorithm, encryptionkey);
let crypted = encrypt.update("123456781234565", "utf8", "hex");
crypted += encrypt.final("hex");
console.log(crypted); // 49a45f088f2c47cc91d62ac5290eaa

const encryptB = cryptoBrowser.createCipher(algorithm, encryptionkey);
let cryptedB = encryptB.update("123456781234565", "utf8", "hex");
cryptedB += encryptB.final("hex");
console.log(cryptedB); // 97a55dbe16a6fad4930e8122a0b554
```

Thank you for explanation and more insight into why it is happening and how to resolve it in case I want to have these special characters in encryption key.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.