rabbitmq / credentials-obfuscation

Tiny library/OTP app for credential obfuscation
Other
14 stars 8 forks source link

Balance security and performance #9

Closed carlhoerberg closed 3 years ago

carlhoerberg commented 3 years ago

1000 iterations seems a bit excessive for simply obfuscating credentials, with these new default MQTT connections can be opened at a rate of 800 connections/s instead of 8 connections/s.

carlhoerberg commented 3 years ago

a nodejs script to churn mqtt connections. (npm install mqtt)

const mqtt = require('mqtt')
const uri = "mqtt://guest:guest@localhost"

function start() {
  const client = mqtt.connect(uri, {
    clean: true,
    connectTimeout: 60000,
    reconnectPeriod: 0,
    rejectUnauthorized: false
  })

  client.on('connect', function () {
    console.log('Connected')
    client.end()
  })

  client.on('close', function() {
    console.log('Close')
  })
}

setInterval(start, 1)
michaelklishin commented 3 years ago

Yes, the idea is primarily to avoid credentials leaking to the logs as part of the process state; we are not looking for best possible security with this library.