
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
算法说明:签名算法MD5和RSA(RSA-SHA1),数据加密算法RSA(RSA_NO_PADDING,node > 0.10.0 && < 6.0.0),AES(aes-128-ecb),DES(des-ede3),返回base64格式数据。
npm install n-crypto
var NCRYPTO = require('n-crypto');
var nCrypto = new NCRYPTO({
md5_key:'',//md5 key
des_key:des_key:'',//des key,24个字符长度
aes_key:aes_key:'',//aes key,16个字符长度
merchant_pri_key:'',//rsa pri key
npay_pub_key:'',//rsa pub key
})
var encryptJson = {
name:"navy",
version:"1.0",
country:"中国",
age:201509110233
}
var sign_type = 'MD5'
var signVal = nCrypto.sign(encryptJson,sign_type);
console.log(signVal);//加密后返回的加密串
var encryptJson = {
name:"navy",
version:"1.0",
country:"中国",
age:201509110233
}
var sign_type = 'MD5';
var md5Sign = 'a12b2084d8c7297a25fcfe452af8257c';
var verifyResult = nCrypto.verify(encryptJson,md5Sign,sign_type);
console.log(verifyResult);//boolean值,true表示验签成功,false表示验签失败
var encryptJson = {
name:"navy",
version:"1.0",
country:"中国",
age:201509110233
}
var sign_type = 'AES';//RSA(node>=0.12),AES,DES
var encryptData = nCrypto.encrypt(encryptJson,sign_type);//base64
console.log(encryptData);//加密后返回的base64加密串
var encryptJson = {
name:"navy",
version:"1.0",
country:"中国",
age:201509110233
}
var sign_type = 'AES';//RSA(node>=0.12),AES,DES
var decryptData = nCrypto.decrypt(encryptJson,sign_type);//原始字符串
console.log(decryptData);//加密后返回的base64加密串
FAQs
We found that n-crypto 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.