generated from cubetiq/ts-project
07e8d22ff2
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.49.0 to 5.50.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.50.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.github | ||
.husky | ||
dist | ||
dummy | ||
src | ||
test | ||
.drone.yml | ||
.eslintrc.js | ||
.gitignore | ||
.prettierrc.json | ||
jest.config.js | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
renovate.json | ||
tsconfig.json |
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
- Sambo Chea sombochea@cubetiqs.com