Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
npm install cryptorjs --save
var cryptorjs = require('cryptorjs');
var myCryptor = new cryptorjs('yourSecretKey');
var encoded = myCryptor.encode('myExampleString');
// => '37d8e07a3dddc2971f3e53b1021f51'
var decoded = myCryptor.decode('37d8e07a3dddc2971f3e53b1021f51');
// => 'myExampleString'
var cryptorjs = require('cryptorjs');
var myCryptor = new cryptorjs('yourSecretKey');
var encoded = myCryptor.encode({ a: 1, b: 2 });
// => '2183c42066819ed9184f1df116'
var decoded = myCryptor.decode('2183c42066819ed9184f1df116');
// => { a: 1, b: 2 }
For example using "blowfish" cipher
var cryptorjs = require('cryptorjs');
var myCryptor = new cryptorjs('yourSecretKey', 'blowfish');
var encoded = myCryptor.encode('myExampleString');
// => 'd21c35352099eac53a129a414530c162'
var decoded = myCryptor.decode('d21c35352099eac53a129a414530c162');
// => 'myExampleString'
You can get the list with a static method
var cryptorjs = require('cryptorjs');
cryptorjs.getCiphers();
/*=> [ 'aes-128-cbc',
'aes-128-cbc-hmac-sha1',
'aes-128-cbc-hmac-sha256',
'aes-128-ccm',
'aes-128-cfb',
'aes-128-cfb1',
'aes-128-cfb8',...]
*/
Create an hash using available hashes in your platform
var cryptorjs = require('cryptorjs');
// Check if exists MD5 hash
console.log(cryptorjs.hasHash('md5')); //=> true
cryptorjs.hash('ciao', 'md5');
/*=> '6e6bc4e49dd477ebc98ef4046c067b5f'*/
cryptorjs.hash('ciao', 'sha1');
/*=> '1e4e888ac66f8dd41e00c5a7ac36a32a9950d271'*/
Cryptorjs is open-sourced software licensed under the MIT license
[2.1.0] - 2017-12-03
hasHash
FAQs
Encrypt and decrypt string, number and object using a key
We found that cryptorjs 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.