Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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]
- Host: GitHub
- URL: https://github.com/fadilxcoder/cryoto-js
- Owner: fadilxcoder
- Created: 2021-09-14T16:11:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-04T20:21:40.000Z (over 2 years ago)
- Last Synced: 2024-11-09T14:32:17.245Z (3 months ago)
- Topics: client, mobile-app, rest-api, security
- Language: JavaScript
- Homepage:
- Size: 311 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)