
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
A list of useful rc4 and base64 functions for Node.js and Browser.
Differently from the previous version, it doesn't use atob() and btoa(); this guarantee a proper base64 conversion between different languages like PHP with base64_encode and base64_decode.

Using npm:
$ npm install npm-rc4
const {
rc4,
rc4Base64Encrypt,
rc4Base64Decrypt,
rc4Base64,
isBase64,
base64encode,
base64decode
} = require('npm-rc4');
import {
rc4,
rc4Base64Encrypt,
rc4Base64Decrypt,
rc4Base64,
isBase64,
base64encode,
base64decode
} from 'npm-rc4';
console.log(
rc4(
'this text is going to be encrypted',
'your keword'
)
);
// => ]}*g ‚ÙÒo©“ÌܟNXà ÝâÂrÀÀÛÎÿ‚¸
console.log(
rc4Base64Encrypt(
'this text is going to be encrypted and encoded with base64',
'your keword'
)
);
// => XX0qG8KkZ8KgwoLDmRfDkm/CqcKTw4zDnMKfTljDoMOdw6LCrXLDgMKbZ8OAw5vDjh3Dv8KCwrhWw51mXsK9wprDk8Kkw6UMfn7CvknCr24DN8KxdsOSwqFrwpQ=
console.log(
rc4Base64Decrypt(
'XX0qG8KkZ8KgwoLDmRfDkm/CqcKQw4bDlsKDUAjDoMOXwqbDr3bCjsKaKcOHw4zDlALDr8KCwrhWw4thTsO1w5/Dn8Kmw7kNLS4=',
'your keword'
)
);
// => this text is decrypted and decoded with base64
console.log(
rc4Base64(
'this function understands if the string have to be decoded or encoded with base64',
'your keword'
)
);
// => XX0qG8KkdcKwwpTDjkPDknPDp8OUw5bDm8KVTArDp8OGwqPCoXPCk8OeYMOFwonDgwXDrsOHwq8Cw45hVMO6w5/DlcKmw7wNO27DsR7CpH9Lc8K2dMOOwqA4w4TCicO4T8KHAzNlw4RvOsOvwp/DgSlgw6swwr3CpC1Swq14
console.log(
rc4Base64(
'XX0qG8KkdcKwwpTDjkPDknPDp8OUw5bDm8KVTArDp8OGwqPCoXPCk8OeYMOFwonDgwXDrsOHwq8Cw45hVMO6w5/DlcKmw7wNO27DsR7CpH9Lc8K2dMOOwqA4w4TCicO4T8KHAzNlw4RvOsOvwp/DgSlgw6swwr3CpC1Swq14',
'your keword'
)
);
// => this function understands if the string have to be decoded or encoded with base64
console.log(
isBase64('Y2lhbw==')
);
// => true
console.log(
isBase64('this string is not base64 of course')
);
// => false
console.log(
base64encode('this string will be encoded with base64')
);
// => dGhpcyBzdHJpbmcgd2lsbCBiZSBlbmNvZGVkIHdpdGggYmFzZTY0
console.log(
base64decode('dGhpcyBzdHJpbmcgd2lsbCBiZSBkZWNvZGVkIHdpdGggYmFzZTY0')
);
// => this string will be decoded with base64
That's it :)
Just a example project where you can see npm-rc4 in action..
Licensed under MIT
FAQs
A list of useful rc4 and base64 functions.
We found that npm-rc4 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.