Free up to 1MM monthly messages. No credit card required.
Here’s what we’ve covered so far:
This is a five part series on building Babel, an open source chat widget and API built with PubNub. Babel allows you to send and receive self destructing, encrypted messages and exchange 1024-bit RSA public keys in a chatroom.
Exchanging public keys is a fundamental component of Babel and developing self destructive messages. Once two users have exchanged public keys, they can then send encrypted messages to one another.
So how does Babel use PubNub to exchange public keys? Let’s walkthrough how you can build your own key exchange system with PubNub.
uuid set to a username that other users will be able to identify us with..
Our next step is to get a public key to be shared. For the purposes of this blog post, we’ll just use a random string to substitute for our public key. However, a more realistic public key string would be something like the Base64 encoding of an RSA public key.
After we get a public key, we can share it with the PubNub Presence feature. To do this, we first subscribe to a PubNub channel and set our
state to an object that contains our username and public key.
Integrating PubNub Presence
PubNub Presence allows users to see who is online and offline, and updates in real time as users log on and off. After subscribing to a channel, other users will be able to see our
state with PubNub Presence.
here_now gets a list of unique user-ids currently subscribed to the channel, the total occupancy of the channel, and also the
state information of all users subscribed to the channel since we set
true in our function call.
The data returned by
here_now to the callback will look something like this.
Thus, to get the
state of all the users subscribed to the channel, you can loop through the
uuids array from the the data returned by
As you can see, exchanging your public keys with PubNub is really easy! However, we’re not done yet. In future blog posts we’ll go over how to send encrypted messages and self-destructing messages through PubNub.
A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.
Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...
Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.