home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / circ / part01 / Circ / README.old next >
Text File  |  1993-08-11  |  7KB  |  189 lines

  1.  
  2. this is a tinyirc client (client not written by me)
  3. but I added in encryption..  Right now encryption is
  4. done in DES for messages and RSA for key exchange.
  5.  
  6. To set it up,  unarchive (you probably already did this)
  7. then type :
  8.     (you should be in the 'irc' dir at this point)
  9.      make sock
  10. this should make a program called 'sock'
  11.  
  12. now you need to go into the RSA directory and make yourself
  13. a keypair.
  14.  
  15.      cd RSA
  16.      make genrsa
  17.      make genprim
  18.      genrsa
  19.  
  20. this makes two files  'public' and 'secret'.  You need to install
  21. these:
  22.      mv secret ..
  23.      mv public ../<yournick>
  24.      cd ..
  25.  
  26. and give out your public key to everyone you want to talk to.
  27. This lets them send their key to you.
  28.  
  29. You must send them your public key *BEFORE* you start talking
  30. to them on irc.  You can do this with mail or with /dcc on
  31. a normal irc client, or any other way you wish.
  32.  
  33. You must also receive keys for the people you wish to talk to
  34. *BEFORE* running the program!  These should be in the same
  35. directory as 'sock' and have they same filename as the
  36. other person's nickname.  So by this point you should have:
  37.    your friends key in a file named after their nickname
  38.    your key in a file called 'secret'
  39.    a binary named 'sock'
  40. all in the same directory.
  41.  
  42. I have supplied a number of public keys from me and my friends.
  43. These are in the directory irc/pubkeys/*.  If you wish to
  44. use any of them copy them into the same directory as you
  45. have 'sock' in:
  46.      cp pubkeys/* .
  47.  
  48. run sock:
  49.       sock
  50.  
  51. join the same channel as your friend you wish to talk to:
  52.       /join #channel
  53.  
  54. send them your key,  this lets them read any message typed by
  55. you (note you have to be in the same channel as them)
  56.       /key <your friend>
  57.  
  58. your friend will receive your key, and now everything you type
  59. can be read by him.  In order to send your key to your friend
  60. you must have the file <your friend> in your directory that
  61. is <your friend>'s public key.  He must have the matching
  62. secret key in the file 'secret' in his directory.  If your
  63. friend changes nick's and the filename of his key isnt the
  64. same as his nick you can specify the file:
  65.        /key <your friend> <filename of his key>
  66.  
  67. (note: this isnt working yet ^^^ will be fixed)
  68. thats it!  Everything you type is encrypted with the same key
  69. which is chosen at random when you start up 'sock'.  Every time
  70. you use sock a new key is used.  Every time you want to talk to
  71. a new person you have to send them your key.  Anyone who has
  72. your key can read any of your messages,  so if you dont want
  73. people reading your messages dont give them your key.  Everything
  74. you type is encrypted.
  75.  
  76.  
  77. some public keys are already provided in pubkeys/*
  78. copy them into current directory to use them.
  79. --------
  80. Weaknesses:
  81.  
  82.   (1) RSA key as created by 'genrsa' is not very long!  It
  83.       is crackable right now.  This could be lengthened
  84.       easily enough by modifying genrsa.c .  The rest of
  85.       the program doesnt care what length key is used.
  86.  
  87.   (2) You can send alot of garbage to someone's screen by
  88.       sending out wrong key's and/or sending out bad
  89.       data matching keys already aquired.
  90.       possible solution: header inside of the encrypted
  91.       data.  1 character would give a 1/256 chance of
  92.       this attack working.
  93.  
  94.   (3) probably alot more I didnt think about.
  95.  
  96. ----------
  97. Protocol:
  98.  
  99. there are two types of messages,  one to send keys across
  100. to other people, one to send across encrypted messages, all
  101. messages are sent to the current irc channel, not through messages
  102. to individual people:
  103.  
  104.    SKPJACK:xxxx:yyyy:zzzzz
  105.         xxxx - the nick name of the intended recipient
  106.         yyyy - the serial number of the key being transfered
  107.         zzzz - ascii encoded RSA data
  108.      messages of this format are used to send private keys (DES
  109.      keys) to the recipient, ie   /key nick.
  110.      Messages received are ignored if xxxxx isnt our current nick.
  111.  
  112.    CLIPPER:xxxx:yyyy
  113.          xxxx - the serial number of the key used to encrypt
  114.          yyyy - the ascii encoded crypted data (DES)
  115.      messages of this format are used to send encrypted chat
  116.      messages.  Messages received are ignored if we dont have
  117.      the key corresponding to the serial number. 
  118.  
  119.    ascii coding:  each byte is broken into 2 nybbles (4 bits)
  120.    and sent across as two characters,  the first nybble
  121.    is sent as   hi+'a' and the second is sent as lo+'A'
  122.    so alternate characters are always upper then lower then
  123.    upper case and so on.  (byte = hi<<4 + lo)
  124.     
  125.    Keys are generated randomly and each key has a random 
  126.    32 bit serial number associated with it.  The program
  127.    uses the serial number to decided which key to decrypt 
  128.    with.  The program keeps all the keys it receives.
  129.    All messages you type are sent with your key,  all messages
  130.    you receive are decoded with the key matching the serial
  131.    number sent with it.
  132.  
  133.    your key and its serial number are generated as follows:
  134.       srand(time(0));   <-- seed random with time
  135.       pick 8 random chars into K
  136.       L=encrypt(K,K)      <-- encrypt K with key K
  137.       serial = (int)L     <-- use this as the serial number
  138.       pick 8 random chars int M
  139.       N=encrypt(M,K)      <-- encrypt M with key K
  140.       N is used as your private DES key
  141.       serial is used to keep track of N 
  142.      
  143.    this should thward attacks trying to guess N given 
  144.    serial and possibly a good guess of time(0);
  145.    encrypt(a,b) means encrypt a with key b in DES
  146. -----
  147. CREDITS
  148.  
  149. Alot of this software was not written by me, In fact my part
  150. was minimal.  I stole code from the following people:
  151.  
  152. The basic IRC client (tinyIRC) by:
  153.  Nathan Laredo - "Green" 
  154.  gt7080a@prism.gatech.edu 
  155.  
  156.  
  157. The RSA package by:    (email address is no longer valid)
  158.  
  159.   Martin Nicolay        ( martin@trillian.megalon.de )
  160.   Fliederstr. 23
  161.   4100 Duisburg 1
  162.   W-Germany
  163.  
  164. I couldn't reach him via email.  I got this package via
  165. anon-ftp,  I hope he doesnt mind use of it in this program.
  166.  
  167.  
  168. The DES package (d3des):
  169.  
  170.  D3DES (V5.09) -
  171.  
  172.  A portable, public domain, version of the Data Encryption Standard.
  173.  
  174.  Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.
  175.  Thanks to: Dan Hoey for his excellent Initial and Inverse permutation
  176.  code;  Jim Gillogly & Phil Karn for the DES key schedule code; Dennis
  177.  Ferguson, Eric Young and Dana How for comparing notes; and Ray Lau,
  178.  for humouring me on.
  179.  
  180.  Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
  181.  (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
  182.  
  183. He says "public domain" and then later "Copyright".  I assume
  184. he means "freely distributable, useable".
  185.  
  186. If any of you are out there thanx alot!  Your code is much
  187. appreciated.
  188.  
  189.