node-laravel-encryptor
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -32,3 +32,3 @@ #!/usr/bin/env node | ||
case '--gen':{ | ||
console.log(Encryptor.generateRandomKey()); | ||
console.log('\x1b[33m%s\x1b[0m', Encryptor.generateRandomKey()); | ||
break; | ||
@@ -51,10 +51,10 @@ } | ||
console.log(); | ||
console.group('[OPTIONS]'); | ||
console.log('[key] => ' + key); | ||
console.log('[value] => ' + valuePreJson); | ||
console.log('[serialize_mode] => ' + cipher.options.serialize_mode); | ||
console.group('\x1b[34m%s\x1b[0m','[OPTIONS]'); | ||
console.log('\x1b[90m[key]\x1b[0m => \x1b[2m' + key + '\x1b[0m'); | ||
console.log('\x1b[90m[value]\x1b[0m => \x1b[2m' + valuePreJson + '\x1b[0m'); | ||
console.log('\x1b[90m[serialize_mode]\x1b[0m => \x1b[2m' + cipher.options.serialize_mode + '\x1b[0m'); | ||
console.groupEnd(); | ||
console.log(); | ||
console.group('[OUTPUT]'); | ||
console.log('[ciphered] => ' + cipher.encryptSync(value)); | ||
console.group('\x1b[93m%s\x1b[0m', '[OUTPUT]'); | ||
console.log('\x1b[2m[ciphered]\x1b[0m => ' + '\x1b[33m' + cipher.encryptSync(value) + '\x1b[0m'); | ||
console.groupEnd(); | ||
@@ -79,11 +79,11 @@ console.log(); | ||
console.log(); | ||
console.group('[OPTIONS]'); | ||
console.log('[key] => ' + key); | ||
console.log('[encrypted] => ' + value); | ||
console.log('[serialize_mode] => ' + cipher.options.serialize_mode); | ||
console.group('\x1b[34m%s\x1b[0m', '[OPTIONS]'); | ||
console.log('\x1b[90m[key]\x1b[0m => \x1b[2m' + key + '\x1b[0m'); | ||
console.log('\x1b[90m[encrypted]\x1b[0m => \x1b[2m' + value + '\x1b[0m'); | ||
console.log('\x1b[90m[serialize_mode]\x1b[0m => \x1b[2m' + cipher.options.serialize_mode + '\x1b[0m'); | ||
console.groupEnd(); | ||
console.log(); | ||
console.group('[OUTPUT]'); | ||
console.log('[deciphered] => ' + decrypted); | ||
console.log('[RAW deciphered] => ' + cipher.getRawDecrypted()); | ||
console.group('\x1b[93m%s\x1b[0m', '[OUTPUT]'); | ||
console.log('\x1b[2m[deciphered]\x1b[0m => ' + '\x1b[33m' + decrypted + '\x1b[0m'); | ||
console.log('\x1b[2m[RAW deciphered]\x1b[0m => ' + '\x1b[33m' + cipher.getRawDecrypted() + '\x1b[0m'); | ||
console.groupEnd(); | ||
@@ -90,0 +90,0 @@ console.log(); |
@@ -0,1 +1,4 @@ | ||
# v2.0.5 | ||
* mocha tests no TS | ||
# v2.0.4 | ||
@@ -2,0 +5,0 @@ * Encryptor npm binary |
@@ -8,3 +8,3 @@ { | ||
"module": "dist/index.js", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "node version Laravel Illuminate/Encryption/Encrypter.php", | ||
@@ -25,9 +25,9 @@ "main": "dist/index.js", | ||
"dev": "tsc -w", | ||
"test": "NODE_ENV=test node_modules/.bin/_mocha --exit --require ts-node/register tests/index.ts", | ||
"test": "NODE_ENV=test node_modules/.bin/_mocha --exit -r tests/lib/spec-helper.js tests/", | ||
"artillery_expect": "artillery run tests/artillery/artillery_expect.yml", | ||
"artillery": "artillery run tests/artillery/artillery.yml", | ||
"artillery_server_async": "node --require ts-node/register tests/express/start-server.ts 1", | ||
"artillery_server_sync": "node --require ts-node/register tests/express/start-server.ts" | ||
"artillery_server_async": "node tests/express/start-server.js 1", | ||
"artillery_server_sync": "node tests/express/start-server.js" | ||
}, | ||
"bin":{ | ||
"bin": { | ||
"encryptor": "bin/encryptor.js" | ||
@@ -47,3 +47,2 @@ }, | ||
"mocha": "^6.2.0", | ||
"ts-node": "^8.4.1", | ||
"typescript": "^2.9.2", | ||
@@ -50,0 +49,0 @@ "uuid": "^3.3.3" |
[![Build Status](https://travis-ci.org/AdSegura/node-laravel-encryptor.svg?branch=master)](https://travis-ci.org/AdSegura/node-laravel-encryptor) | ||
[![npm version](https://badge.fury.io/js/node-laravel-encryptor.svg)](https://badge.fury.io/js/node-laravel-encryptor) | ||
[![node version](https://badgen.net/badge/node/%3E=8.10.0/green)](https://badgen.net/badge/node/%3E=8.10.0/green) | ||
# node-laravel-encryptor | ||
@@ -18,3 +19,3 @@ | ||
## Prerequisites | ||
* NodeJs `>=v8.16.1 (npm v6.4.1)` | ||
* NodeJs `>=v8.10.0 (npm v5.6.0)` | ||
@@ -439,20 +440,2 @@ ## Laravel Compatibility | ||
#### [Dont block the event loop](https://nodejs.org/en/docs/guides/dont-block-the-event-loop/) | ||
>Blocking the Event Loop: Node core modules | ||
> | ||
> Several Node core modules have synchronous expensive APIs, including: | ||
> | ||
> Encryption | ||
> Compression | ||
> File system | ||
> Child process | ||
> | ||
> These APIs are expensive, because they involve significant computation (encryption, compression), require I/O (file I/O), or potentially both (child process). These APIs are intended for scripting convenience, but are not intended for use in the server context. If you execute them on the Event Loop, they will take far longer to complete than a typical JavaScript instruction, blocking the Event Loop. | ||
> | ||
> ### In a server, you should not use the following synchronous APIs from these modules: | ||
> | ||
> Encryption: | ||
> crypto.randomBytes (synchronous version) | ||
#### Laravel Encrypter format: | ||
@@ -474,3 +457,3 @@ | ||
### Contributing | ||
Pull requests are welcome! | ||
Pull requests are welcome. | ||
@@ -477,0 +460,0 @@ ### License |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
8
41
90760
1965
460
4
2