@hugoalh/symmetric-crypto
An ECMAScript (JavaScript & TypeScript) module to provide an easier symmetric crypto.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.7%) to scientific vocabulary
Keywords
Repository
An ECMAScript (JavaScript & TypeScript) module to provide an easier symmetric crypto.
Basic Info
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 40
Topics
Metadata Files
README.md
Symmetric Crypto (ES)
An ECMAScript (JavaScript & TypeScript) module to provide an easier symmetric crypto.
🔰 Begin
🎯 Targets
| Targets | Remote | JSR | NPM | |:--|:-:|:-:|:-:| | Bun >= v1.1.0 | ❌ | ❓ | ✔️ | | Deno >= v2.1.0 | ✔️ | ✔️ | ✔️ | | NodeJS >= v20.9.0 | ❌ | ❓ | ✔️ |
[!NOTE] - It is possible to use this module in other methods/ways which not listed in here, however those methods/ways are not officially supported, and should beware maybe cause security issues.
#️⃣ Resources Identifier
- Remote - GitHub Raw:
https://raw.githubusercontent.com/hugoalh/symmetric-crypto-es/{Tag}/mod.ts - JSR:
[jsr:]@hugoalh/symmetric-crypto[@{Tag}] - NPM:
[npm:]@hugoalh/symmetric-crypto[@{Tag}]
[!NOTE] - For usage of remote resources, it is recommended to import the entire module with the main path
mod.ts, however it is also able to import part of the module with sub path if available, but do not import if:
- it's path has an underscore prefix (e.g.:
_foo.ts,_util/bar.ts), or- it is a benchmark or test file (e.g.:
foo.bench.ts,foo.test.ts), or- it's symbol has an underscore prefix (e.g.:
_bar,_foo).These elements are not considered part of the public API, thus no stability is guaranteed for them. - For usage of JSR or NPM resources, it is recommended to import the entire module with the main entrypoint, however it is also able to import part of the module with sub entrypoint if available, please visit the file
jsr.jsoncpropertyexportsfor available sub entrypoints. - It is recommended to use this module with tag for immutability.
🛡️ Runtime Permissions
- File System - Read (Deno:
read; NodeJS:fs-read):- Resources (Optional)
- File System - Write (Deno:
write; NodeJS:fs-write):- Resources (Optional)
🧩 APIs
ts class SymmetricCryptorBasic { constructor(key: SymmetricCryptorKeyInput | SymmetricCryptorKeyType, options?: SymmetricCryptorOptions); constructor(keys: readonly (SymmetricCryptorKeyInput | SymmetricCryptorKeyType)[], options?: Omit<SymmetricCryptorOptions, "times">); decrypt(data: string): Promise<string>; decrypt(data: Uint8Array): Promise<Uint8Array>; encrypt(data: string): Promise<string>; encrypt(data: Uint8Array): Promise<Uint8Array>; }ts class SymmetricCryptor extends SymmetricCryptorBasic { decryptFileInPlace(filePath: string | URL): Promise<void>; encryptFileInPlace(filePath: string | URL): Promise<void>; readEncryptedFile(filePath: string | URL, options?: Deno.ReadFileOptions): Promise<Uint8Array>; readEncryptedTextFile(filePath: string | URL, options?: Deno.ReadFileOptions): Promise<string>; writeEncryptedFile(filePath: string | URL, data: Uint8Array, options?: Omit<Deno.WriteFileOptions, "append">): Promise<void>; writeEncryptedTextFile(filePath: string | URL, data: string, options?: Omit<Deno.WriteFileOptions, "append">): Promise<void>; }ts interface SymmetricCryptorOptions { cipherTextCoder?: SymmetricCryptorCipherTextCoderDefault | SymmetricCryptorCipherTextCoderOptions; times?: number; }ts interface SymmetricCryptorCipherTextCoderOptions { decoder: SymmetricCryptorCipherTextDecoder; encoder: SymmetricCryptorCipherTextEncoder; }ts interface SymmetricCryptorKeyInput { algorithm?: SymmetricCryptorAlgorithm; key: SymmetricCryptorKeyType; }ts type SymmetricCryptorAlgorithm = | "AES-CBC" | "AES-CTR" | "AES-GCM";ts type SymmetricCryptorCipherTextDecoder = (data: string) => Uint8Array | Promise<Uint8Array>;ts type SymmetricCryptorCipherTextEncoder = (data: Uint8Array) => string | Promise<string>;ts type SymmetricCryptorCipherTextCoderDefault = | "base64" | "base64url";ts type SymmetricCryptorKeyType = | string | ArrayBuffer | BigUint64Array | DataView | Uint8Array | Uint16Array | Uint32Array;
[!NOTE] - For the full or prettier documentation, can visit via: - Deno CLI
deno doc- JSR
✍️ Examples
ts const data = "qwertyuiop"; const cryptor = new SymmetricCryptor("<PassWord123456>!!"); const encrypted = await cryptor.encrypt(data); console.log(encrypted); // "6zUMUyY3gQaKqCZZOcFGucdlpnQa5i97PfypJpByA+Y=" const decrypted = await cryptor.decrypt(encrypted); console.log(decrypted); // "qwertyuiop"
Owner
- Name: hugoalh
- Login: hugoalh
- Kind: user
- Location: Everywhere
- Company: @hugoalh-studio
- Twitter: hugoalhofficial
- Repositories: 12
- Profile: https://github.com/hugoalh
Lead of @hugoalh-studio; Full time software developer; Part time freelancer
Citation (CITATION.cff)
# yaml-language-server: $schema=https://citation-file-format.github.io/1.2.0/schema.json cff-version: "1.2.0" title: "Symmetric Crypto (ES)" message: "If you use this software, please cite it using the metadata from this file." type: "software" authors: - name: "hugoalh" repository-code: "https://github.com/hugoalh/symmetric-crypto-es" keywords: - "crypto" - "ecmascript" - "ecmascript-module" - "es" - "es-module" - "esm" - "esmodule" - "javascript" - "js" - "symmetric" - "ts" - "typescript" license: "MIT"
GitHub Events
Total
- Release event: 3
- Delete event: 6
- Issue comment event: 3
- Push event: 31
- Pull request review event: 5
- Pull request event: 11
- Create event: 6
Last Year
- Release event: 3
- Delete event: 6
- Issue comment event: 3
- Push event: 31
- Pull request review event: 5
- Pull request event: 11
- Create event: 6
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 0
- Total pull requests: 100
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.9
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 99
Past Year
- Issues: 0
- Pull requests: 24
- Average time to close issues: N/A
- Average time to close pull requests: 15 days
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.71
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 23
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (97)
- hugoalh (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 100 last-month
- Total dependent packages: 3
- Total dependent repositories: 2
- Total versions: 40
- Total maintainers: 1
npmjs.org: @hugoalh/symmetric-crypto
A module to provide an easier symmetric crypto.
- Homepage: https://github.com/hugoalh/symmetric-crypto-es#readme
- License: MIT
-
Latest release: 4.2.1
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- @hugoalh/advanced-determine 7.0.2
- @hugoalh/undefinish 1.0.10
- @hugoalh/advanced-determine ^7.0.2
- actions/checkout v3.3.0 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3.3.0 composite
- github/super-linter v4.10.1 composite
- hugoalh/send-discord-webhook-ghaction v5.0.0 composite
- actions/checkout v3.3.0 composite
- actions/setup-node v3.6.0 composite
- actions/checkout v3.3.0 composite
- hugoalh/scan-virus-ghaction v0.6.4 composite