fork(3) download
  1. var crypto = require('crypto');
  2. //en
  3. function cipher (buf) {
  4. var rc4Key = "c2eWxyNe5c4G9GUHMQECzcUEWUK8MWkk"
  5. var cipher = crypto.createCipher('rc4', (rc4Key+"48LoIDEv8EQOrmwPirikDa3iUaickMSq"),1);
  6. var cryptedBuffers = [cipher.update(buf)];
  7. cryptedBuffers.push(cipher.final());
  8. var crypted = Buffer.concat(cryptedBuffers);
  9. return crypted;
  10. };
  11. var buf1 = Buffer.from([
  12. 0x03, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
  13. ]);
  14.  
  15. console.log(cipher((buf1)));
  16. //<Buffer 6f 61 f8 95 ab ba aa 90>
Success #stdin #stdout 0.08s 187968KB
stdin
Standard input is empty
stdout
<Buffer 6f 61 f8 95 ab ba aa 90>