Recently we added the ability to send encrypted messages with Octoblu. We created a simple proof-of-concept encrypted chat service to show off this new capability.

You can watch the video here: Encrypted Chat with Octoblu

Requirements:

  1. npm install -g meshblu-util
  2. npm install meshblu-secure-chat

cd node_modules/meshblu-secure-chat
meshblu-util register > meshblu.json
meshblu-util keygen meshblu.json
npm start

On Machine B

cd node_modules/meshblu-secure-chat
meshblu-util register > meshblu.json
meshblu-util keygen meshblu.json
npm start

Send Unencrypted Message from Machine A to Machine B

/uuid (UUID FROM MACHINE B)
Everyone can read this

# => { devices: , payload: 'Everyone can read this' }

Send Encrypted Message From Machine A to Machine B

/uuid (UUID FROM MACHINE B)
/encrypted true
Shhh... It's a secret!

# => GET https://meshblu.octoblu.com/devices/(UUID FROM MACHINE B)/public_key
# -----BEGIN PUBLIC KEY-----
# MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl+1lSZNRVZfODbgre2og
# YuwGjc0SJuAfGLDBKApl4TE8yfEnbwBQHDFWs2l2YkTFfDVvP4gckssW1pcbquG2
# zbqIvoeuDvAbdetUTffuGl0rzSubh4biSSQfYzallHbxYUNqICBaJWaX1mOck5bC
# ZK/hR+wnNXJyMt26XXHdjL6hIInJajo0kjf+DeNY7xSYXSjL2jMAPVExl3BuSHhS
# hT5lqq5pKCWLtT0DIUndVxVg0poOJXDBJsC/n6CfTfPWt9n48C8MIDymOArxHNbn
# LQ3ftDEX3g0Vo+DgJE912DIuWLDRVviHAPtschh4KEVYJFkFOpXnR0kLWnCUH7Vl
# SwIDAQAB
# -----END PUBLIC KEY-----
# => { encryptedPayload: 'HKAVoOUccZHoZC1MvxuQ8bOAc6dyHoVd2v83ncf3
# eNXFDst80Vt8sYyV4U3Nm0jFnuaKx6jS8MCZ9CPlPwrvfEdn1UI8BRxZhUNDV183
# Gug2UZNDByp+cTp11nW9MbrvdQhFOX0NlhkoMCFgafFNImvZoYsmHzXOMKtpM7s3
# a8PrN++WKF2Rm1dyY4AwQ3g02DxqjpOn1SYQI1s+UnsKzeNgCtEodoEC0rkb81Gi
# xMvovD9d9YmJIy4oc1k6Gg5KpFZ4aU9kVxCOrN0U6tSpRE3U0hzFJ/LFwDWvkiAg
# 4EoDPKzCE+UBMoH4i7s6LoYdyz1vVI6mbulNBgT/yEY5mA==' }

View the source code on GitHub: octoblu/meshblu-secure-chat