Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(encryption): possible invalid quotes failing decryption on simple…
Browse files Browse the repository at this point in the history
…-crypto-js
  • Loading branch information
rhahao authored May 5, 2022
1 parent 8148553 commit ec45422
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"react-error-overlay": "^6.0.9"
"@semantic-release/git": "^10.0.1"
}
}
4 changes: 3 additions & 1 deletion src/utils/sws-cryptr.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export const encryptString = (secret, payload) => {

export const decryptString = (secret, payload) => {
const simpleCrypto = new SimpleCrypto(secret);
return simpleCrypto.decrypt(payload);
// remove quotes
const cypheredText = payload.substr(0, payload.length);
return simpleCrypto.decrypt(cypheredText);
};

0 comments on commit ec45422

Please sign in to comment.