Skip to content

Commit

Permalink
fix: initial
Browse files Browse the repository at this point in the history
  • Loading branch information
phoqe committed Jun 5, 2021
1 parent acdf0ba commit 123af0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const createEncryptionKey = (browser, version) => {
password, // password
"saltysalt", // salt
1, // iterations
128, // keylen
16, // keylen
"sha1", // digest
(error, key) => {
if (error) {
Expand Down Expand Up @@ -118,7 +118,7 @@ exports.decryptData = (browser, data) => {
}

const dataString = data.toString();
let version = null;
let version;

// Check that the incoming data was encrypted and with what version.
// Credit card numbers are current legacy unencrypted data at the time of writing.
Expand All @@ -144,7 +144,7 @@ exports.decryptData = (browser, data) => {
}

const iv = Buffer.alloc(16, "20", "hex");
const decipher = crypto.createDecipheriv("aes-128-gcm", key, iv);
const decipher = crypto.createDecipheriv("aes-128-cbc", key, iv);
const ciphertext = Buffer.from(data).toString("base64");
const rawCiphertext = ciphertext.substring(version);
let plaintext = decipher.update(rawCiphertext, "base64", "utf8");
Expand Down

0 comments on commit 123af0c

Please sign in to comment.