Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fadilxcoder/cryoto-js

Crypto - Client of hfx-api - Reverse proxy - [https://github.com/fadilxcoder/reverse-proxy.git] [https://github.com/fadilxcoder/hfx-api.git]
https://github.com/fadilxcoder/cryoto-js

client mobile-app rest-api security

Last synced: 21 days ago
JSON representation

Crypto - Client of hfx-api - Reverse proxy - [https://github.com/fadilxcoder/reverse-proxy.git] [https://github.com/fadilxcoder/hfx-api.git]

Awesome Lists containing this project

README

        

# Notes

- - **Static** Crypto.js --> **PHP** Reverse proxy [https://github.com/fadilxcoder/reverse-proxy.git] --> **PHP** HFX Api server [https://github.com/fadilxcoder/hfx-api.git]

- Decrypt string

```

var DataEncrypt = "icAESDk4FQYhhubVwCPExcnax7VMUxfHJlbrbGKg3cXBRg2ZqHRf8uXk9hOnSFVlcsuerf1+62RxmZVrXS4n1UqBiv8ruZnj00BMWnOa5u0=";

var DataKey = CryptoJS.enc.Utf8.parse("37305569879051012722482875850017");
var DataVector = CryptoJS.enc.Utf8.parse("8975106574091384");

var decrypted = CryptoJS.AES.decrypt(DataEncrypt, DataKey, { iv: DataVector });
var decrypted = CryptoJS.enc.Utf8.stringify(decrypted);

console.log(DataEncrypt);
console.log(decrypted);

```

Using node.js

- Install https://www.npmjs.com/package/crypto-js
- https://www.npmjs.com/package/http-server (static HTTP server)
- `npm i crypto-js`
- https://www.npmjs.com/package/http-server
- Generate SSL by `openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem`, cretae a `cert.pem`
- Lanch by `http-server` OR for SSL `http-server -S -C cert.pem`
- Set `webpack` in dev mode by editing `webpack.config.js` section `mode: "development"`
- Use configs in `.env` directly in webpack
- https://www.npmjs.com/package/dotenv-webpack (dotenv-webpack)
- Install `npm i dotenv-webpack`
- Call API with bearer
- https://www.npmjs.com/package/axios
- Install `npm i axios`
- https://github.com/axios/axios (Github repo)