@indra.ai/deva 1.21.0 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/actions.json +2 -0
- package/lib/index.js +1 -2
- package/package.json +1 -1
package/config/actions.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -55,14 +55,13 @@ class LIB {
|
|
|
55
55
|
***************/
|
|
56
56
|
encrypt(str, opts) {
|
|
57
57
|
const {password, algorithm} = opts;
|
|
58
|
-
const key = createHash('
|
|
58
|
+
const key = createHash('sha256').update(String(password)).digest('base64');
|
|
59
59
|
const key_in_bytes = Buffer.from(key, 'base64')
|
|
60
60
|
const iv = randomBytes(16);
|
|
61
61
|
// create a new cipher
|
|
62
62
|
const _cipher = createCipheriv(algorithm, key_in_bytes, iv);
|
|
63
63
|
const encrypted = _cipher.update(String(str), 'utf8', 'hex') + _cipher.final('hex');
|
|
64
64
|
|
|
65
|
-
this.action('return', 'encrypt');
|
|
66
65
|
return {
|
|
67
66
|
iv: iv.toString('base64'),
|
|
68
67
|
key,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "64907438819979111427",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.21.
|
|
4
|
+
"version": "1.21.1",
|
|
5
5
|
"description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "VLA:64907438819979111427 LICENSE.md",
|