README.ufc-crypt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. The following is the README for UFC-crypt, with those portions deleted
  2. that are known to be incorrect for the implementation used with the
  3. GNU C library.
  4. UFC-crypt: ultra fast 'crypt' implementation
  5. ============================================
  6. @(#)README 2.27 11 Sep 1996
  7. Design goals/non goals:
  8. ----------------------
  9. - Crypt implementation plugin compatible with crypt(3)/fcrypt.
  10. - High performance when used for password cracking.
  11. - Portable to most 32/64 bit machines.
  12. - Startup time/mixed salt performance not critical.
  13. Features of the implementation:
  14. ------------------------------
  15. - On most machines, UFC-crypt runs 30-60 times faster than crypt(3) when
  16. invoked repeated times with the same salt and varying passwords.
  17. - With mostly constant salts, performance is about two to three times
  18. that of the default fcrypt implementation shipped with Alec
  19. Muffets 'Crack' password cracker. For instructions on how to
  20. plug UFC-crypt into 'Crack', see below.
  21. - With alternating salts, performance is only about twice
  22. that of crypt(3).
  23. - Requires 165 kb for tables.
  24. Author & licensing etc
  25. ----------------------
  26. UFC-crypt is created by Michael Glad, email: glad@daimi.aau.dk, and has
  27. been donated to the Free Software Foundation, Inc. It is covered by the
  28. GNU library license version 2, see the file 'COPYING.LIB'.
  29. NOTES FOR USERS OUTSIDE THE US:
  30. ------------------------------
  31. The US government limits the export of DES based software/hardware.
  32. This software is written in Aarhus, Denmark. It can therefore be retrieved
  33. from ftp sites outside the US without breaking US law. Please do not
  34. ftp it from american sites.
  35. Benchmark table:
  36. ---------------
  37. The table shows how many operations per second UFC-crypt can
  38. do on various machines.
  39. |--------------|-------------------------------------------|
  40. |Machine | SUN* SUN* HP* DecStation HP |
  41. | | 3/50 ELC 9000/425e 3100 9000/720 |
  42. |--------------|-------------------------------------------|
  43. | Crypt(3)/sec | 4.6 30 15 25 57 |
  44. | Ufc/sec | 220 990 780 1015 3500 |
  45. |--------------|-------------------------------------------|
  46. | Speedup | 48 30 52 40 60 |
  47. |--------------|-------------------------------------------|
  48. *) Compiled using special assembly language support module.
  49. It seems as if performance is limited by CPU bus and data cache capacity.
  50. This also makes the benchmarks debatable compared to a real test with
  51. UFC-crypt wired into Crack. However, the table gives an outline of
  52. what can be expected.
  53. Optimizations:
  54. -------------
  55. Here are the optimizations used relative to an ordinary implementation
  56. such as the one said to be used in crypt(3).
  57. Major optimizations
  58. *******************
  59. - Keep data packed as bits in integer variables -- allows for
  60. fast permutations & parallel xor's in CPU hardware.
  61. - Let adjacent final & initial permutations collapse.
  62. - Keep working data in 'E expanded' format all the time.
  63. - Implement DES 'f' function mostly by table lookup
  64. - Calculate the above function on 12 bit basis rather than 6
  65. as would be the most natural.
  66. - Implement setup routines so that performance is limited by the DES
  67. inner loops only.
  68. - Instead of doing salting in the DES inner loops, modify the above tables
  69. each time a new salt is seen. According to the BSD crypt code this is
  70. ugly :-)
  71. Minor (dirty) optimizations
  72. ***************************
  73. - combine iterations of DES inner loop so that DES only loops
  74. 8 times. This saves a lot of variable swapping.
  75. - Implement key access by a walking pointer rather than coding
  76. as array indexing.
  77. - As described, the table based f function uses a 3 dimensional array:
  78. sb ['number of 12 bit segment']['12 bit index']['48 bit half index']
  79. Code the routine with 4 (one dimensional) vectors.
  80. - Design the internal data format & uglify the DES loops so that
  81. the compiler does not need to do bit shifts when indexing vectors.
  82. Revision history
  83. ****************
  84. UFC patchlevel 0: base version; released to alt.sources on Sep 24 1991
  85. UFC patchlevel 1: patch released to alt.sources on Sep 27 1991.
  86. No longer rebuilds sb tables when seeing a new salt.
  87. UFC-crypt pl0: Essentially UFC pl 1. Released to comp.sources.misc
  88. on Oct 22 1991.
  89. UFC-crypt pl1: Released to comp.sources.misc in march 1992
  90. * setkey/encrypt routines added
  91. * added validation/benchmarking programs
  92. * reworked keyschedule setup code
  93. * memory demands reduced
  94. * 64 bit support added