Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
node-laravel-encryptor
Advanced tools
NodeJS version of Laravel's Encrypter Class, tested 5.4.30 to 6.0 Illuminate/Encryption/Encrypter.php
With this module you can create the encrypted payload for a cookie from Node Js and be read by Laravel.
Laravel only allows AES-128-CBC
AES-256-CBC
.
If no algorithm is defined default is AES-256-CBC
{
"iv": "iv in base64",
"value": "encrypted data",
"mac": "Hash HMAC"
}
$> npm i node-laravel-encryptor
const {Encryptor} = require('node-laravel-encryptor');
let encryptor = new Encryptor({
key: 'Laravel APP_KEY without base64:',
});
encryptor
.encrypt({foo: 'bar'})
.then(enc => console.log(enc));
encryptor
.decrypt(enc)
.then(dec => console.log(dec));
const {EncryptorSync} = require('node-laravel-encryptor');
let encryptor = new EncryptorSync({
key: 'Laravel APP_KEY without base64:',
});
const enc = encryptor.encrypt({foo: 'bar'});
console.log(encryptor.decrypt(enc))
base64:
DEPRECIATED
if no key_length
is given default is 64.
arguments:
if no serialize
option is given default is to serialize.
arguments:
if no serialize
option is given default is to unserialize.
$> npm run test
To be able to run PHP test you must have installed:
$> npm run test
node Laravel Encrypter
✓ should cipher and decipher
✓ should fail cipher and decipher object without serialize
✓ should cipher and decipher with no key_length defined
✓ should cipher and decipher with no serialize nor unserialize
✓ should fail cipher not valid Laravel Key
✓ should fail cipher not valid algorithm
✓ should fail decipher not valid data
✓ should cipher and decipher multiple times
✓ should decipher data at Laravel correctly (52ms)
✓ should decipher from Laravel correctly (50ms)
✓ should cipher and decipher Sync Mode
✓ should decipher data, Sync Mode, at Laravel correctly (45ms)
12 passing (173ms)
Express Crypto Cookie Compatible with Laravel
✓ should create one request to Express aSync Mode, receive cookie and decipher (41ms)
✓ should create one request to Express Sync Mode, receive cookie and decipher
✓ should create multiple parallel requests to Express aSync Mode, receive cookie and decipher
✓ should create multiple parallel requests to Express Sync Mode, receive cookie and decipher
4 passing (83ms)
FAQs
node version Laravel Illuminate/Encryption/Encrypter.php
The npm package node-laravel-encryptor receives a total of 437 weekly downloads. As such, node-laravel-encryptor popularity was classified as not popular.
We found that node-laravel-encryptor 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
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.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.