From 130473e110ad6798dd230d5cbb8e372e89556da8 Mon Sep 17 00:00:00 2001 From: CDeltakai Date: Thu, 29 May 2025 15:22:04 +1000 Subject: [PATCH] chore: update js-lint to 0.2.11 and delete .prettierrc since its no longer needed --- .prettierrc | 7 ------- README.md | 40 +++++++++++++++++++++++++++++----------- package-lock.json | 14 +++++++------- package.json | 2 +- 4 files changed, 37 insertions(+), 26 deletions(-) delete mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index fa9699b8..00000000 --- a/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "semi": true, - "trailingComma": "all", - "singleQuote": true, - "printWidth": 80, - "tabWidth": 2 -} diff --git a/README.md b/README.md index 917e7f9a..2a0d2785 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,12 @@ Encrypted filesystem library for TypeScript/JavaScript applications -- Virtualised - files, directories, permissions are all virtual constructs, they do not correspond to real filesystems +- Virtualised - files, directories, permissions are all virtual constructs, they + do not correspond to real filesystems - Orthogonally Persistent - all writes automatically persisted - Encrypted-At-Rest - all persistence is encrypted -- Random Read & Write - encryption and decryption operates over fixed-block sizes +- Random Read & Write - encryption and decryption operates over fixed-block + sizes - Streamable - files do not need to loaded fully in-memory - Comprehensive continuous benchmarks in CI/CD @@ -58,9 +60,11 @@ await efs.destroy(); ### Encryption & Decryption Protocol -Encryption & Decryption implemented using the `node-forge` library. However it is possible to plug in your own `encrypt` and `decrypt` functions. +Encryption & Decryption implemented using the `node-forge` library. However it +is possible to plug in your own `encrypt` and `decrypt` functions. -Internally we use the AES-GCM symmetric encryption using a master `dbKey` that can be 128, 192 or 256 bits long. +Internally we use the AES-GCM symmetric encryption using a master `dbKey` that +can be 128, 192 or 256 bits long. The `dbKey` can be generated from several methods: @@ -75,15 +79,20 @@ For example: const [key, salt] = await generateKeyFromPass('secure password'); ``` -This uses PBKDF2 to derive a symmetric key. The default key length will be 256 bits. For deterministic key generation, make sure to specify the `salt` parameter. +This uses PBKDF2 to derive a symmetric key. The default key length will be 256 +bits. For deterministic key generation, make sure to specify the `salt` +parameter. ```ts const [key, salt] = await generateKeyFromPass('secure password', 'salt'); ``` -Construction of `EncryptedFS` relies on an optional `blockSize` parameter. This is by default set to 4 KiB. All files are broken up into 4 KiB plaintext blocks. When encrypted, they are persisted as ciphertext blocks. +Construction of `EncryptedFS` relies on an optional `blockSize` parameter. This +is by default set to 4 KiB. All files are broken up into 4 KiB plaintext blocks. +When encrypted, they are persisted as ciphertext blocks. -The ciphertext blocks contain an initialization vector plus an authorisation tag. Here is an example of the structure: +The ciphertext blocks contain an initialization vector plus an authorisation +tag. Here is an example of the structure: ``` | iv (16 bytes) | authTag (16 bytes) | ciphertext data (x bytes) | @@ -95,9 +104,16 @@ The ciphertext data length is equal to the plaintext block length. There are some differences between EFS and Node FS: -- User, Group and Other permissions: In EFS User, Group and Other permissions are strictly confined to their permission class. For example, a User in EFS does not have the permissions that a Group or Other has while in Node FS a User also has permissions that Group and Other have. -- Sticky Files: In Node FS, a sticky bit is a permission bit that is set on a file or a directory that lets only the owner of the file/directory or the root user to delete or rename the file. EFS does not support the use of sticky bits. -- Character Devices: Node FS contains Character Devices which can be written to and read from. However, in EFS Character Devices are not supported yet. +- User, Group and Other permissions: In EFS User, Group and Other permissions + are strictly confined to their permission class. For example, a User in EFS + does not have the permissions that a Group or Other has while in Node FS a + User also has permissions that Group and Other have. +- Sticky Files: In Node FS, a sticky bit is a permission bit that is set on a + file or a directory that lets only the owner of the file/directory or the root + user to delete or rename the file. EFS does not support the use of sticky + bits. +- Character Devices: Node FS contains Character Devices which can be written to + and read from. However, in EFS Character Devices are not supported yet. ## Development @@ -124,7 +140,9 @@ npm run lintfix npm run bench ``` -View benchmarks here: https://github.com/MatrixAI/js-encryptedfs/blob/master/benches/results with https://raw.githack.com/ +View benchmarks here: +https://github.com/MatrixAI/js-encryptedfs/blob/master/benches/results with +https://raw.githack.com/ ### Docs Generation diff --git a/package-lock.json b/package-lock.json index b07e17a3..4fd1482f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ }, "devDependencies": { "@fast-check/jest": "^2.1.0", - "@matrixai/lint": "^0.2.6", + "@matrixai/lint": "^0.2.11", "@swc/core": "1.3.82", "@swc/jest": "^0.2.29", "@types/jest": "^29.5.2", @@ -1877,9 +1877,9 @@ "license": "Apache-2.0" }, "node_modules/@matrixai/lint": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@matrixai/lint/-/lint-0.2.6.tgz", - "integrity": "sha512-Cbx6SCTAqSt7lTKkaXL7wB+KbkiXYpQ0LdV5fPcnzEfG0sCuG8dbJcwzgHT5Qn7ubG71BBLUVFjHY1EGADzT8g==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@matrixai/lint/-/lint-0.2.11.tgz", + "integrity": "sha512-Q/atLaVExgQbd7b/sXCvTAIus0M+egxr6fjHFNzpUZGY3Gu+UkYQrel/440JnvZ+fK8fq9GTHewpa14H08AcRw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -10952,9 +10952,9 @@ "integrity": "sha512-75hH7ZTmhM/VXeICXCPiVr/ZxQSoBwXh2HOI3AhD8AGYDDsEJsm4tnDSr/6vT3vS0ryZb3kb9mpAmCeibdrF3w==" }, "@matrixai/lint": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@matrixai/lint/-/lint-0.2.6.tgz", - "integrity": "sha512-Cbx6SCTAqSt7lTKkaXL7wB+KbkiXYpQ0LdV5fPcnzEfG0sCuG8dbJcwzgHT5Qn7ubG71BBLUVFjHY1EGADzT8g==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@matrixai/lint/-/lint-0.2.11.tgz", + "integrity": "sha512-Q/atLaVExgQbd7b/sXCvTAIus0M+egxr6fjHFNzpUZGY3Gu+UkYQrel/440JnvZ+fK8fq9GTHewpa14H08AcRw==", "dev": true, "requires": { "@eslint/compat": "^1.2.5", diff --git a/package.json b/package.json index 32bae4e9..c46e453d 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "util-callbackify": "^1.0.0" }, "devDependencies": { - "@matrixai/lint": "^0.2.6", + "@matrixai/lint": "^0.2.11", "@fast-check/jest": "^2.1.0", "@swc/core": "1.3.82", "@swc/jest": "^0.2.29",