
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Created by André Oliveira (@oliveira086)
Pré requisitos:
npm install Encryptoo
Utilizando com Es6:
import Encryptoo from 'encryptoo';
const localPublicKey = Encryptoo.init();
Outro modo:
const Encryptoo = require('encyptoo');
const localPublicKey = Encryptoo.init();
O fluxo de troca de chaves deve partir do frontend para o backend. O front deve montar um objeto semelhate esse abaixo:
{
clientPublicKey: Encryptoo.init()
}
Após montar o objeto deverá realizar uma requisição post ao seu backend.
Após receber a requisição no backend você deve enviar sua chave publica como resposta da requisição, para o frontend.
let serverPublicKey = Encryptoo.init();
response.status(200).json({
serverPublicKey: serverPublicKey,
}).send();
Depois de receber a chave publica do frontend você decide a melhor forma de atrelar aquela chave com a sessão atual do front. Com a chave publica do frontend você já consegue encryptar e decryptar as informações fornecidas pelo front como também ele consegue decryptar as informações que o backend envia.
import Encryptoo from 'encryptoo';
const cryptogram = Encryptoo.encrypt(plainText, serverPublicKey);
import Encryptoo from 'encryptoo';
const cryptogram = Encryptoo.encryptBody(object, serverPublicKey);
import Encyptoo from 'encryptoo';
const plainText = Encryptoo.decrypt(textEncrypted, serverPublicKey);
import Encyptoo from 'encryptoo';
const plainText = Encryptoo.decryptBody(object, serverPublicKey);
import Encryptoo from 'encryptoo';
const verifySing = Encryptoo.compare(plainText, cryptogram, serverPublicKey);
import Encryptoo from 'encryptoo';
Encryptoo.setSecret(secret);
O segredo deve ter 32 bytes
import Encryptoo from 'encryptoo';
const secret = Encryptoo.getSecret(serverPublicKey);
Função importante principalmente para o lado do servidor. Em toda nova troca de chaves do lado do servidor você deve passar o parametro isServer = true. Exemplo:
Encryptoo.getSecret(serverPublicKey, true);
Assim em toda nova troca de chaves do lado do servidor a chave será gerada corretamente.
Implementação dos metódos principais de encrypt e decrypt utilizando a troca de chaves Diffie Hellman e criptografia AES.
FAQs
Biblioteca de Criptografia com troca de chaves Diffie Hellman.
The npm package encryptoo receives a total of 2 weekly downloads. As such, encryptoo popularity was classified as not popular.
We found that encryptoo demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.