home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18548 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  3.8 KB

  1. Xref: sparky comp.lang.c:18548 comp.lang.c++:18143 comp.lang.pascal:7551
  2. Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.pascal
  3. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!wo0z!lwloen
  4. From: lwloen@rchland.vnet.ibm.com (Larry Loen)
  5. Subject: Re: Encryption algorythm/code needed...
  6. Sender: news@rchland.ibm.com
  7. Message-ID: <1992Dec17.190305.9642@rchland.ibm.com>
  8. Date: Thu, 17 Dec 1992 19:03:05 GMT
  9. Reply-To: lwloen@rchland.vnet.ibm.com
  10. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  11. References: <Byt18n.6Cr@andy.bgsu.edu> <1992Dec7.160128.18678@sbcs.sunysb.edu> <1992Dec8.131745.13670@ncsu.edu> <13DEC92.17873883.0049@music.mus.polymtl.ca>
  12. Nntp-Posting-Host: wo0z.rchland.ibm.com
  13. Organization: IBM Rochester
  14. Lines: 68
  15.  
  16. In article <13DEC92.17873883.0049@music.mus.polymtl.ca>, CT80@music.mus.polymtl.ca (Steph) writes:
  17. |> In article <1992Dec8.131745.13670@ncsu.edu> jlnance@eos.ncsu.edu (JAMES LEWIS NANCE) writes:
  18. |> >
  19. |> >In article <1992Dec7.160128.18678@sbcs.sunysb.edu>, clane@csws2.ic.sunysb.edu (Charles F Lane) writes:
  20. |> >|>
  21. |> >|> >the usernames and passwords.  The code need not be extravagent...  I only
  22. |> >|> >need to encrypt single words (letters and numbers both).
  23. |> >|> >
  24. |> >
  25. |> >|> A very easy way to encrypt data is to use a random number generator.  Suppose
  26. |> >|> you have a string "CHAIR".  Assign a value to your random number generator's
  27. |> >|> seed.  Then add random(256) to the ord of the first character (C, in this
  28. |> >|> case), then random(256) + ord("H"), random(256) + ord("A"), etc.  When adding
  29. |> >|> the random number you should wrap around if the sum is > 255.  In tp just
  30. |> >|> disable range checking.  Decrypting is just as easy -- reassign the original
  31. |> >|> seed value and subtract the "random" number rather than adding.  Code (TP) to
  32. |> >|> encrypt/decrypt a string follows:
  33. |> >|>
  34. |> >
  35. |> >Be careful if you use this, as it is not secure encode multiple things using
  36. |> >the same starting seed.  For example, if you keep your entries like this:
  37. |> >
  38. |> >myusername:mypasswd
  39. |> >urusername:urpasswd
  40. |> >
  41. |> >And you encrypt each line using this method, starting with the same initial
  42. |> >seed, then I can take my username and password, which I know and figure out
  43. |> >what you added to them to encrypt them.  Then I can subtract these numbers
  44. |> >from your username and your passwd.  Since they were encrypted with the same
  45. |> >method and the same key, this will give me your unencrypted name and password.
  46. |> >
  47. |> >
  48. |> >
  49. |> >Jim
  50. |> >.
  51. |> >.
  52. |> I used the same method, with a variant : I would seed a new value to
  53. |> my random number generator, based on the current letter.  So, you
  54. |> start the same way (one seed), but then the encrypted data will not
  55. |> be the same at all after but a few letters since the random number
  56. |> generator will be shooting 'totally' different numbers.
  57. |> 
  58. |> <
  59. |> 
  60. |> 
  61. |> Steph.
  62. |> Who needs a .sig?
  63.  
  64.  
  65. AAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaauuuuuuuuuuggggggggggghhhhhh.
  66.  
  67. Sorry about that, but I had to get it out.  Nothing personal.
  68.  
  69. This vampire cannot be killed.  Please, please, please, people, give it up.
  70. This is not something that can be done on the back of an envelope.  You
  71. are all nicely re-inventing known methods that do not work.  They provide
  72. more or less security, but are all well-behind the state of the art by
  73. minimum of forty years.  You will probably defeat the programmer in the
  74. next cublicle and thereby think you are doing well, but a real expert will
  75. simply make mincemeat of all of this stuff.  Some of these methods don't
  76. even require a computer to break!
  77.  
  78. Could I ask this discussion move over to sci.crypt where others can weigh
  79. in and explain all of this?
  80.  
  81. -- 
  82.    Larry W. Loen        |  My Opinions are decidedly my own, so please
  83.                         |  do not attribute them to my employer
  84.