PGP based messaging system...

Status
Not open for further replies.
Hi there. I've been pondering what I would like to see in an IM framework, and what is missing from the ones I've read about or used. It seems that in an IM system one needs:


  • Widespread distribution, no central server dependency
  • Security
  • Presence
  • Message transportation mechanisms


Things such as ease of use and client programs are not as important as the base functionality of the system, because those would fall in place if a system that took care of the above needs was developed.

I look at systems such as SMTP and POP3 as a successful concept of how a delayed message system should/does work. I, however, see a few problems with this model as far as Instant Messaging is concerned. The primary problem, in my eye, is that a user is restricted to using the system that they have an email address with. My email address, for example, limits me to using f2s.com's servers for accessing email. I don't think this is the proper design for IM systems, because mobility is very important. I don't think it is a good idea or a correct design to have to use a "home" server to maintain one's identity (as it seems jabber does).

Okay, so I'm still just talking. I've been thinking up a system for the last few weeks that solves, In my mind, some (if not all if designed and implemented well) of these problems and adequately fits the needs of an IM framework:


  • Identities would be PGP public keys, with optional routing information attached to them; PGP-Public-Key@most-probable-host or just PGP-Public-Key.
  • Clients connect to any server they desire, probably the closest to them, it doesn't even matter though.
  • Servers would use a shortcut broadcasting mechanism to locate users (PGP public keys), and to disseminate presence information requests/subscriptions (actual presence distribution would be done in a direct, non-broadcast, manner).
  • Messages would be encrypted with the user's PGP public key that you want to send to, and optionally signed with your key. The receiving user then uses their private key to decrypt the message. Simple public-key encryption, just like in emails...
  • Security is excellent because in the process of transporting the message no intermediate step would be able to decode the message without the proper private key (obviously). Servers would not transport plain text anything.
  • Plenty of key servers exist right now, so getting a user's public key would not be too difficult ("Go to keys.pgp.net and look for cobalt@f2s.com" (I don't have a PGP key there)) and may be able to be built into clients.


These are some of my thoughts. I have many more pages worth of how servers could interact, how information can be disseminated without using tremendous amounts of bandwidth, etc. I just wanted to post this to see if anyone:


  • Has any critique, comments, or questions about the feasibility, necessity, or implementation of such a system.
  • Is interested in helping to develop such a system.


Anyhow, I'll let ya'll ruminate... :)

[This message was edited by Cobalt on January 10, 2002 at 18:39.]
 

jfmiller28

Ars Centurion
206
Subscriptor
Sounds interesting,

Could something like this be built on top of the Gnutilla network with PGP fingerprints being used as file names?

Something like this:

Search for "file" namde C8_D4_AA_56_B2_4F_14_6D.pgp
Download that file which is a public key and IPAddress
Use this IPAddress to start a p2p chat.
Incidently could also be used to securly transport files

Question: would SSH be better then PGP?

JFMILLER
 
jfmiller28, not really. One would not want to use anything like Gnutella for this type of system. One of the problems with Gnutella is the broadcasting it does of EVERYTHING, in the system I imagine one could use shortcut broadcasting, based on hints and some intelligent assumptions, and make it so you hardly ever do broadcasting. The system I'm thinking of would use MUCH less bandwidth/resources and even a small gnutella network.

SSH could be used, but to be honest it wouldn't be of any extra security really. I mean, as long as the private key is secure then the system is VERY secure. I suppose a direct connect mode with SSL sockets could be an attractive option for the paranoid.

I can outline the broadcasting strategy I envision (and the resources a server would have to keep to accomplish it) if anyone is interested...
 

Coleman

Ars Legatus Legionis
16,790
Subscriptor
There already is a PGP plugin program for ICQ that lets you encrypt your messages...so at least to some extent it's already possible to do what you are talking about.

But really, between two parties, it seems to me to make more sense to encrypt all communications between the two(i.e. at the protocol level) instead of just at the app level, at least for this type of communication. And you can already do that in several ways.


-Jason
 

russ-iha

Ars Praefectus
4,407
Subscriptor
How would you really ever know if someone was online and the server just couldn't find them in broadcast or they were really offline?

I think you'd be better off with a distributed server / client setup... machines marked as 'servers' keep a local database of all the clients attatched to them. They keep another database of users for the servers they are attatched to. Basically you are using something akin to routing tables. Not sure how it would all work but a system could be devised I think.


How about each message has a 64-bit header.... 32-bits identify server, the last 32 identify the acutal client ID#, which never changes. When you logon, your ID is the server you are on plus your client ID. If a server receives a request for server #0, or itself, for a client that it does not know, it sends out a request for that client... this request passes along in peer-to-peer fashon among all the "servers" until one responds that it knows this client.

I dunno, just musing.


the "servers" could be real server machines ,or just clients with broadband who tick a checkbox that says they are willing to serve. In this way, small-time operations can help, but if someone has access to a big pipe and a hefty box they can do a little bit more than just pass along a little bit of peer info.
 
Yes, either way of security works, it seems to me that by using PGP keys as an identity, one could use existing infastructure such as key servers, etc. It allows for mobility that other forms of identity may not. For example, with my email address, cobalt@f2s.com, I would always have to go through f2s.com... Any other scheme, not tying a user to a server for identity, it seems to me, requires extra infastructure... Just my thoughts...
 
My thoughts as to a possible implementation of presence (by user I mean PGP public key):


  • Servers would maintain a set of users (PGP public keys) that are currently logged on.
  • Servers would also maintain a set of the users that have ever used that server (in a given amount of time, say, a week)...
  • Servers would maintain a map of (user -> server). The server thinks this is where a user is.


At this point, when a user tries to ask where another user is the server would:


  • Look at it's logged on user list.
  • Look at it's map of (user -> server) and if found ask the server if the user is still there.
  • Start a broadcast (only one server at a time though, starting with the "best" server first), asking about the user. Each of the other servers starts this whole process again. If found, it responds positive. If found in its addressing map, reply with a hint to the original server about where a good place to look would be. If the server found no mention of the user, reply with nothing found. The original server reorders its broadcast order list based on the hints it got, asking the hinted at servers first in the next broadcasting. The original server stops when it find the user online.


Now, with something like that, I think we could find where any user is.

Now, for presence information... The list of users to ever use the Server would be key in this. The presence system could be based on interests. When a user logs in, the give their contact list to the server (probably in some condensed form... md5sums of the PGP keys?), the server then says to the other servers, "Hey, I'm interested in the status of these people." The other servers go okay, but only pay attention to the users that happen to be in the list of users to ever have used they server. This system would disseminate presence information, as well as seed addressing lists to help reduce broadcasting and network bog...

Well, that's just my rough ideas so far. Any comments or ideas?
 
Are not PHP keys rather large? Wouldn't it be prohibitive to use the as the user ID? And besides, it is good to be able to nullify a public key. (If the private key is compromised or lost.)

So why not a IM with a PKI built in? (Or use an external PKI.)

And when it comes to using user@server take a look at the Jabber protocol. (Which also does encryption.)

You could extend the idea of PKI however and automatically use the RSA system for authentication as well as encrytpion. That could be useful.
 
Hast, yes, PGP keys are large (circa 1-4kb). On a protocol level, one could probably use something like md5sums of a public key to acutally route on at the server level.

Internally, an ID translation could happen like this:

PGP public key -> md5sum @ server

And messages could contain the PGP public key of the sender, if it were signed, for example, or if it was necessary.

EDIT: My understanding of Jabber is that once you are associated with a server (as part of your address), then this server is tied to your identity (user@server)... Is this correct? If it is, then that seems to me to not be necessary, and something to be avoided...
 
Ok, my main point was though that perhaps using the actual key, or a hash, is counter productive.

I can't give that ID to people, becuase there is no way I will be able to remember it. And if I loose my private keys then I will have to setup a new account.

But the idea of using PKI as something central part of the IM is a good one. And also to make a more flexible server system.

Actually it might be an idea to use a DNS like scheme for the username lookups. You have the same general idea there.

And yes, I think you are correct that Jabbers system is permanently bound to the specific server. Much like email.
 
Yeah, one of the biggest problems pointed out by some of my friends about this system is the problem of how to actually find anyone... With most IM systems, it is easy, "type in 123ABC into the box and that's me", for example. One would never be able to tell your friend a 4k public key and expect them to do anything with it. So yeah, an interface to a public key system would be necessary. I'm pretty sure it would not be too difficult if done properly.

My conception of server interactions would make the system work, I believe; most of the problems lie in whether it is the best implementation, whether it would be too bandwidth intensive (a la Gnutella), and then client problems. The largest client problems would be caused by misunderstanding public key encryption and discovering other users...
 

EgalitarianBovine

Ars Tribunus Angusticlavius
8,086
I've thought a lot of about doing something like this, and actually half-implemented it in C++.. so I have a few things to suggest.

First, can you get rid of the distinction between server and client? Just make every client a node in the network. This is akin to how gnutella works, and I know you have issues with that, but I think those can be avoided.

First of all, only lookups should happen through a network.. the actual chatting can be done directly between two clients, as long as at least one of the clients is not behind a firewall. Also, if two clients are both behind firewalls, it might be possible to allow other non-firewalled nodes on the network to form a direct bridge between the two firewalled machines.

This means that the only thing that would get broadcast across the network is lookups for users. Now, if the client were designed to cache lookups, this will reduce a LOT of lookups from traversing the network as well, because it will eliminate all cases where the person being looked up has a static IP address (so the cached IP address works).

So, by removing the chatting, and caching lookup results on the client, I think it'd be possible to avoid a lot of the issues with having a flat broadcast network.

Also, one of the main benefits of a gnutella-like network is that it gives you more anonymity. User B looking up user A can be done by broadcasting a "lookup" message, where B encrypts A's public key, and a random challenge string, with A's public key. This means that the only user who will be able to tell who B is looking up, will be user A. Absolute and complete anonymity. When user A gets the lookup message, he can decrypt it, and sign the challenge string, and contact B directly. So the only people who know about the conversation, it's members, wether it happened, and it's contents, are A and B.

Also there's a very simple solution to the 'naming' problem inherent in the system. To make the system workable, all you really need is another system capable of transferring keys across the internet (e-mail, IRC, ICQ, usenet, and websites are all valid candidates). If person A wanted to allow person B to contact them over the network, they need to give person B their public key. Person B finds this public key in a website, e-mail, irc chat, usenet post, or wherever. He copies and pastes it into the client program's "add new contact" dialog box. The program asks him "what do you want to call this user?", and B enters a name for remembering that key. The key point is that there is no centralized naming system. Only public keys are unique, but names are decentralized and nonunique. Any person can refer to any other person using any name they want. Once you can accept that, you can imagine a simple delivery system for this kind of information. For example, you can enable the client to read Personal Information Packages, which would contain a user's public key, their preferred nickname, and optionally other info (like their real names, etc).

What do you think?

-EB
 
Cobalt:
What is needed is a three basic services:

  • Add new user.
  • Retrive a users public key.
  • Lookup IP of user.

Those are essential. (Just repeating them to make it more clear.) These are also here arranged in order of decreasing life time. That is, your IP changes more frequently than your public key. So it could be and idea to let that data propagate through the servers, which is good for redundancy as well.

EgalitarianBovine:
First, can you get rid of the distinction between server and client?
I'm not sure that is such a good idea. At least not at first. The problem is that, just as Gnutella demonstrated, it doesn't scale well. I remember that the Gnutella team began experimenting with methods for making the network self-regulating, I don't know how far they managed to get though. The easiest would be to at least at first have separate client and servers. (Naturally you could run them both on the same computer.) And then if it can be shown that it would actually work fuse them together.

Now I'm going to put on the "besserwisser hat". ;-)
Now, if the client were designed to cache lookups(...)
This means that the only user who will be able to tell who B is looking up, will be user A.
While both are nice ideas it's a bit hard to cache data which you can't read. ;-) And it would also require that if I wanted to find a specific user every computer on the net would have to try it. (O(n) at any rate.) I dare say that it wouldn't scale very well. ;-)

Generally though the problem with P2P is that it's hard to get it to scale and not require rediculous amounts of control data to be transferred over the net. I think the concept of "distributed servers" is more appropriate. Because not all that many will be interested in running a server, nor is there a need for it.

For more comments on these types of nets I'd recommend broswing through some white papers on Mojo Nation, Freenet and Gnutella. Because it's a lot of work to make a P2P net scale. (Perhaps too much, even though the idea is appealing.)
 
I really don't like the idea of using anything close to a Gnutella style P2P network. It would litter the airways (so to speak) with tons of very useless control data (as Hast said). In Gnutella it isn't that bad because who knows who will have what you're looking for, so in that sense, this is the simplest way to work around the problem. With a messaging system, however, there are only going to be specific hosts that know about what you want (rather, can give you the absolute answer), so asking everyone about something is rarely a good idea. I don't think that the checkbox server/client idea is that good either, because the ratio of server/client will probably be something like 1/1000 or something (near the same ratio of smtp server/email address served, probably)... The whole P2P network will scale much better if while the clients increase linearly, the number of servers increases in some sort of logarithmic sense (at least that is my gut reaction to the problem)...
 
Status
Not open for further replies.