You should protect API keys.
Last updated 2 years ago
Install crypto-js
npm install crypto-js
Create a new reusable Functions
import CryptoJS from 'crypto-js'; function ApiEncrypt(apiKey,secretKey){ // Encrypt var ciphertext = CryptoJS.AES.encrypt(apiKey, secretKey).toString(); return ciphertext; } export default ApiEncrypt;