@blocklet/sdk 1.8.65-beta-f7af64a4 → 1.8.65-beta-bfcc12ce
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/lib/security/index.js +4 -4
- package/package.json +14 -14
package/lib/security/index.js
CHANGED
|
@@ -5,20 +5,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.decrypt = exports.encrypt = void 0;
|
|
7
7
|
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
-
const
|
|
9
|
-
const AES = { default:
|
|
8
|
+
const aes_legacy_1 = __importDefault(require("@ocap/mcrypto/lib/crypter/aes-legacy"));
|
|
9
|
+
const AES = { default: aes_legacy_1.default }.default;
|
|
10
10
|
const encrypt = (message) => {
|
|
11
11
|
if (!process.env.BLOCKLET_DID || !process.env.BLOCKLET_APP_EK) {
|
|
12
12
|
return message;
|
|
13
13
|
}
|
|
14
|
-
return AES.encrypt(message, crypto_1.default.pbkdf2Sync(process.env.BLOCKLET_APP_EK, process.env.BLOCKLET_DID, 256, 32, 'sha512').toString('hex'));
|
|
14
|
+
return (AES.encrypt(message, crypto_1.default.pbkdf2Sync(process.env.BLOCKLET_APP_EK, process.env.BLOCKLET_DID, 256, 32, 'sha512').toString('hex')));
|
|
15
15
|
};
|
|
16
16
|
exports.encrypt = encrypt;
|
|
17
17
|
const decrypt = (message) => {
|
|
18
18
|
if (!process.env.BLOCKLET_DID || !process.env.BLOCKLET_APP_EK) {
|
|
19
19
|
return message;
|
|
20
20
|
}
|
|
21
|
-
return AES.decrypt(message, crypto_1.default.pbkdf2Sync(process.env.BLOCKLET_APP_EK, process.env.BLOCKLET_DID, 256, 32, 'sha512').toString('hex'));
|
|
21
|
+
return (AES.decrypt(message, crypto_1.default.pbkdf2Sync(process.env.BLOCKLET_APP_EK, process.env.BLOCKLET_DID, 256, 32, 'sha512').toString('hex')));
|
|
22
22
|
};
|
|
23
23
|
exports.decrypt = decrypt;
|
|
24
24
|
exports.default = {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.65-beta-
|
|
6
|
+
"version": "1.8.65-beta-bfcc12ce",
|
|
7
7
|
"description": "graphql client to read/write data on abt node",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"typings": "lib/index.d.ts",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@abtnode/client": "1.8.65-beta-
|
|
30
|
-
"@abtnode/constant": "1.8.65-beta-
|
|
31
|
-
"@arcblock/did-auth": "1.18.
|
|
32
|
-
"@arcblock/jwt": "1.18.
|
|
33
|
-
"@arcblock/ws": "1.18.
|
|
34
|
-
"@blocklet/constant": "1.8.65-beta-
|
|
35
|
-
"@blocklet/meta": "1.8.65-beta-
|
|
36
|
-
"@did-connect/authenticator": "^2.1.
|
|
37
|
-
"@did-connect/handler": "^2.1.
|
|
38
|
-
"@nedb/core": "^2.1.
|
|
39
|
-
"@ocap/mcrypto": "1.18.
|
|
40
|
-
"@ocap/wallet": "1.18.
|
|
29
|
+
"@abtnode/client": "1.8.65-beta-bfcc12ce",
|
|
30
|
+
"@abtnode/constant": "1.8.65-beta-bfcc12ce",
|
|
31
|
+
"@arcblock/did-auth": "1.18.42",
|
|
32
|
+
"@arcblock/jwt": "1.18.42",
|
|
33
|
+
"@arcblock/ws": "1.18.42",
|
|
34
|
+
"@blocklet/constant": "1.8.65-beta-bfcc12ce",
|
|
35
|
+
"@blocklet/meta": "1.8.65-beta-bfcc12ce",
|
|
36
|
+
"@did-connect/authenticator": "^2.1.34",
|
|
37
|
+
"@did-connect/handler": "^2.1.34",
|
|
38
|
+
"@nedb/core": "^2.1.5",
|
|
39
|
+
"@ocap/mcrypto": "1.18.42",
|
|
40
|
+
"@ocap/wallet": "1.18.42",
|
|
41
41
|
"axios": "^0.27.2",
|
|
42
42
|
"fs-extra": "^10.1.0",
|
|
43
43
|
"joi": "17.7.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"ts-node": "^10.9.1",
|
|
69
69
|
"typescript": "^4.8.4"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "f6a56512275a55feecf2f3953542ea98777a08f2"
|
|
72
72
|
}
|