Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
JavaScript library of crypto standards.
Requirements:
npm install cryptojs2
Node.js
import sha256 from 'cryptojs2/sha256';
import hmacSHA256 from 'cryptojs2/hmac-sha256';
//or
import {SHA256 as sha256,HmacSHA256 as hmacSha256} from "cryptojs2";
const message, nonce, path, privateKey; // ...
const hashDigest = sha256(nonce + message);
const hmacDigest = Base64.stringify(hmacSHA512(path + hashDigest, privateKey));
Requirements:
Modular include:
<script type="module">
import sha256 from 'cryptojs2/sha256';
import hmacSHA256 from 'cryptojs2/hmac-sha256';
//or
import {SHA256 as sha256,HmacSHA256 as hmacSha256} from "cryptojs2";
window.sha256 = sha256; //FOR USE ALL DOCUMENT
window.hmacSHA256 = hmacSHA256; //FOR USE ALL DOCUMENT
var hashSHA256 = sha256("Message");
var hashhmacSha256 =hmacSha256("stringToSign", "signingKey");
</script>
import aes from 'cryptojs2/AES';
import hmacSHA256 from 'cryptojs2/hmac-sha256';
// Encrypt
var ciphertext = aes.encrypt('message', 'secret key').toString();
// Decrypt
var bytes = aes.decrypt(ciphertext, 'secret key');
var originalText = bytes.toString();
console.log(originalText); // 'message'
import aes from 'cryptojs2/AES';
var data = [{id: 1}, {id: 2}]
// Encrypt
var ciphertext = aes.encrypt(JSON.stringify(data), 'secret key 123').toString();
// Decrypt
var bytes = aes.decrypt(ciphertext, 'secret key 123');
var decryptedData = JSON.parse(bytes.toString());
console.log(decryptedData); // [{id: 1}, {id: 2}]
cryptojs2/md5
cryptojs2/sha1
cryptojs2/sha256
cryptojs2/sha224
cryptojs2/sha512
cryptojs2/sha384
cryptojs2/sha3
cryptojs2/ripemd160
cryptojs2/hmac-md5
cryptojs2/hmac-sha1
cryptojs2/hmac-sha256
cryptojs2/hmac-sha224
cryptojs2/hmac-sha512
cryptojs2/hmac-sha384
cryptojs2/hmac-sha3
cryptojs2/hmac-ripemd160
cryptojs2/pbkdf2
cryptojs2/aes
cryptojs2/tripledes
cryptojs2/rc4
cryptojs2/rabbit
cryptojs2/rabbit-legacy
MIT license; see LICENSE.
FAQs
cryptojs2 with import
The npm package cryptojs2 receives a total of 7 weekly downloads. As such, cryptojs2 popularity was classified as not popular.
We found that cryptojs2 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.