@sequencemedia/crypto 1.1.73 → 1.2.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/babel.config.cjs +0 -2
- package/package.json +4 -11
- package/.gitattributes +0 -15
- package/lib/index.cjs +0 -1
- package/lib/shell/decrypt.cjs +0 -2
- package/lib/shell/encrypt.cjs +0 -2
package/babel.config.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/crypto",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"crypto",
|
|
6
6
|
"node",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"decode",
|
|
12
12
|
"shell"
|
|
13
13
|
],
|
|
14
|
-
"main": "./
|
|
14
|
+
"main": "./src/index.mjs",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"types": "./crypto.d.mts",
|
|
17
17
|
"author": {
|
|
@@ -25,12 +25,6 @@
|
|
|
25
25
|
"url": "git@github.com:sequencemedia/crypto.git"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "npm run babel",
|
|
29
|
-
"watch": "npm run babel -- -w",
|
|
30
|
-
"clean": "rimraf lib",
|
|
31
|
-
"babel": "babel src -d lib --out-file-extension .cjs",
|
|
32
|
-
"prepublishOnly": "npm run build",
|
|
33
|
-
"prebuild": "npm run clean",
|
|
34
28
|
"lint": "eslint . --ext .mjs --ext .cjs",
|
|
35
29
|
"lint:fix": "npm run lint -- --fix",
|
|
36
30
|
"prepare": "husky install"
|
|
@@ -40,7 +34,7 @@
|
|
|
40
34
|
"@babel/core": "^7.22.1",
|
|
41
35
|
"@babel/eslint-parser": "^7.21.8",
|
|
42
36
|
"@babel/preset-env": "^7.22.4",
|
|
43
|
-
"@sequencemedia/hooks": "^1.0.
|
|
37
|
+
"@sequencemedia/hooks": "^1.0.430",
|
|
44
38
|
"@types/node": "^20.2.5",
|
|
45
39
|
"core-js": "^3.30.2",
|
|
46
40
|
"eslint": "^8.41.0",
|
|
@@ -51,7 +45,6 @@
|
|
|
51
45
|
"husky": "^8.0.3"
|
|
52
46
|
},
|
|
53
47
|
"exports": {
|
|
54
|
-
"
|
|
55
|
-
"require": "./lib/index.cjs"
|
|
48
|
+
".": "./src/index.mjs"
|
|
56
49
|
}
|
|
57
50
|
}
|
package/.gitattributes
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Default behavior
|
|
2
|
-
* text=auto
|
|
3
|
-
|
|
4
|
-
# LF line endings
|
|
5
|
-
*.json text eol=lf
|
|
6
|
-
*.mjs text eol=lf
|
|
7
|
-
*.cjs text eol=lf
|
|
8
|
-
*.mts text eol=lf
|
|
9
|
-
*.sh text eol=lf
|
|
10
|
-
.editorconfig text eol=lf
|
|
11
|
-
.eslintignore text eol=lf
|
|
12
|
-
.eslintrc text eol=lf
|
|
13
|
-
.gitattributes text eol=lf
|
|
14
|
-
.gitignore text eol=lf
|
|
15
|
-
.husky/* text eol=lf
|
package/lib/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.decrypt=decrypt;exports.encrypt=encrypt;exports.hashKey=hashKey;var _crypto=_interopRequireDefault(require("crypto"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function hashKey(secret){if(!secret)throw new Error('A secret is required');return _crypto.default.createHash('sha256').update(secret).digest('base64').substring(0,32);}function encrypt(buffer,secret,bytes=16,algorithm='aes-256-ctr'){const iv=_crypto.default.randomBytes(bytes);const cipher=_crypto.default.createCipheriv(algorithm,hashKey(secret),iv);return Buffer.concat([iv,cipher.update(buffer),cipher.final()]);}function decrypt(buffer,secret,bytes=16,algorithm='aes-256-ctr'){const iv=buffer.slice(0,bytes);const decipher=_crypto.default.createDecipheriv(algorithm,hashKey(secret),iv);return Buffer.concat([decipher.update(buffer.slice(bytes)),decipher.final()]);}
|
package/lib/shell/decrypt.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";var _crypto=require("@sequencemedia/crypto");const{env:{CRYPTO_KEY}={},stdout,openStdin}=process;let collector=Buffer.from('');openStdin().on('data',buffer=>{collector=Buffer.concat([collector,buffer]);}).on('end',()=>{stdout.write((0,_crypto.decrypt)(collector,CRYPTO_KEY));});
|
package/lib/shell/encrypt.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";var _crypto=require("@sequencemedia/crypto");const{env:{CRYPTO_KEY}={},stdout,openStdin}=process;let collector=Buffer.from('');openStdin().on('data',buffer=>{collector=Buffer.concat([collector,buffer]);}).on('end',()=>{stdout.write((0,_crypto.encrypt)(collector,CRYPTO_KEY));});
|