Skip to content

Commit

Permalink
0.0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed May 14, 2023
1 parent 773a099 commit efe24f5
Show file tree
Hide file tree
Showing 6 changed files with 361 additions and 288 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package.json
package-lock.json
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
semi: true,
trailingComma: "all",
singleQuote: false,
printWidth: 140,
useTabs: false,
tabWidth: 2,
endOfLine: "lf",
};
5 changes: 4 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"common": {
"name": "nissan",
"version": "0.0.12",
"version": "0.0.15",
"title": "Nissan",
"news": {
"0.0.15": {
"en": "Make Nissan EV compatible with Node >=18"
},
"0.0.12": {
"en": "Fix remote commands"
},
Expand Down
13 changes: 6 additions & 7 deletions lib/leaf-connect/lib/encrypt-password.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// const crypto = require('crypto')
const Blowfish = require('egoroof-blowfish')
const Blowfish = require("egoroof-blowfish");

module.exports = (password, passwordEncryptionKey) => {
// const cipher = crypto.createCipheriv('bf-ecb', Buffer.from(passwordEncryptionKey), Buffer.from(''))
// let encrypted = cipher.update(password, 'utf8', 'base64')
// encrypted += cipher.final('base64')
const bf = new Blowfish(passwordEncryptionKey, Blowfish.MODE.ECB, Blowfish.PADDING.PKCS5) // only key isn't optional
// bf.setIv('00000000') // iv isn't optional
const encoded = bf.encode(password, Blowfish.TYPE.STRING)
const bf = new Blowfish(passwordEncryptionKey, Blowfish.MODE.ECB, Blowfish.PADDING.PKCS5); // only key isn't optional
const encoded = bf.encode(password, Blowfish.TYPE.STRING);
//convert to base64
const encodedB64 = Buffer.from(encoded).toString('base64')
return encodedB64
}
const encodedB64 = Buffer.from(encoded).toString("base64");
return encodedB64;
};
Loading

0 comments on commit efe24f5

Please sign in to comment.