Go to file
dependabot[bot] 08bcf51260
Bump @typescript-eslint/parser from 5.30.0 to 5.30.5
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.0 to 5.30.5.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.5/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 04:37:49 +00:00
.github Create codeql.yml 2022-03-26 09:36:28 +07:00
.husky Initial commit 2022-02-14 10:24:23 +07:00
dist Updated build for crytojs 2022-02-15 11:58:10 +07:00
dummy Task: Fixed aes and tests 2022-02-14 18:41:48 +07:00
src Task: Add write file from string and tests 2022-02-15 11:57:23 +07:00
test Task: Add write file from string and tests 2022-02-15 11:57:23 +07:00
.drone.yml Update '.drone.yml' 2022-04-01 11:49:26 +07:00
.eslintrc.js Initial commit 2022-02-14 10:24:23 +07:00
.gitignore Task: Add write file from string and tests 2022-02-15 11:57:23 +07:00
.prettierrc.json Initial commit 2022-02-14 10:24:23 +07:00
jest.config.js Task: Completed for cryptojs and tests functions and validate keys 2022-02-14 12:30:32 +07:00
LICENSE Initial commit 2022-02-14 10:24:23 +07:00
package-lock.json Bump @typescript-eslint/parser from 5.30.0 to 5.30.5 2022-07-05 04:37:49 +00:00
package.json Bump @typescript-eslint/parser from 5.30.0 to 5.30.5 2022-07-05 04:37:49 +00:00
README.md Add guide for README.md 2022-02-14 16:05:17 +07:00
tsconfig.json Add build and allow dist 2022-02-14 16:15:32 +07:00

CUBETIQ CryptoJS

  • Default Encryption
  • E2E Encryption

How-to-use

  • Default Encryption Provider
const key = "67rKmuc6DiDukE0jsUP421Eizo4CreaL6Q7Pg/NmH/s="
const iv = "FEFM9AY2m5jDq6GZ+CfLIA=="
const text = "Hello World"
const provider = CryptoProvider.newInstance(
    new DefaultCryptoProvider({
        key: key,
        iv: iv,
    })
)

const encrypted = provider.encrypt(text)
const decrypted = provider.decrypt(encrypted)

// Output
console.log(text) // "Hello World"
console.log(decrypted) // "Hello World"
  • E2E Encryption Provider
const PRIVATE_KEY_VALUE = "-----BEGIN RSA PRIVATE KEY-----"
const PUBLIC_KEY_VALUE = "-----BEGIN RSA PUBLIC KEY-----"

const text = "Hello World"
const provider = CryptoProvider.newInstance(
    new E2ECryptoProvider({
        publicKey: PUBLIC_KEY_VALUE,
        privateKey: PRIVATE_KEY_VALUE,
    })
)

const encrypted = provider.encrypt(text)
const decrypted = provider.decrypt(encrypted)

// Output
console.log(text) // "Hello World"
console.log(decrypted) // "Hello World"

Generate for Default Encryption (Key and IV)

const key = crypto.randomBytes(32)
const iv = crypto.randomBytes(16)

Generate for E2E Encryption (Public and Private Key)

openssl genrsa -out rsa_4096_priv.pem 4096
openssl rsa -pubout -in rsa_4096_priv.pem -out rsa_4096_pub.pem

Contributors