implament rc4 encrypt with ts.
npm i rc4-ts
# or
yarn add rc4-ts
import RC4 from 'rc4-ts';
const encryptKey = '123456';
const rc4 = new RC4(encryptKey);
const needEncryptData = 'abcde';
const base64Data = window.btoa(window.unescape(window.encodeURIComponent(needEncryptData)));
const encryptResult = rc4.encrypt(base64Data);
const decryptResult = rc4.decrypt(encryptResult);
const finalResult = window.decodeURIComponent(window.escape(window.atob(decryptResult)));
- Encrypt http req entity
- localStorage user infomation