d3des.c
上传用户:sbftbdw
上传日期:2007-01-03
资源大小:379k
文件大小:18k
源码类别:

远程控制编程

开发平台:

Visual C++

  1. /*
  2.  * This is D3DES (V5.09) by Richard Outerbridge with the double and
  3.  * triple-length support removed for use in VNC.  Also the bytebit[] array
  4.  * has been reversed so that the most significant bit in each byte of the
  5.  * key is ignored, not the least significant.
  6.  *
  7.  * These changes are Copyright (C) 1998 Olivetti & Oracle Research Laboratory
  8.  *
  9.  * This software is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12.  */
  13. /* D3DES (V5.09) -
  14.  *
  15.  * A portable, public domain, version of the Data Encryption Standard.
  16.  *
  17.  * Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.
  18.  * Thanks to: Dan Hoey for his excellent Initial and Inverse permutation
  19.  * code;  Jim Gillogly & Phil Karn for the DES key schedule code; Dennis
  20.  * Ferguson, Eric Young and Dana How for comparing notes; and Ray Lau,
  21.  * for humouring me on.
  22.  *
  23.  * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
  24.  * (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
  25.  */
  26. #include "d3des.h"
  27. static void scrunch(unsigned char *, unsigned long *);
  28. static void unscrun(unsigned long *, unsigned char *);
  29. static void desfunc(unsigned long *, unsigned long *);
  30. static void cookey(unsigned long *);
  31. static unsigned long KnL[32] = { 0L };
  32. static unsigned long KnR[32] = { 0L };
  33. static unsigned long Kn3[32] = { 0L };
  34. static unsigned char Df_Key[24] = {
  35.         0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
  36.         0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10,
  37.         0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 };
  38. static unsigned short bytebit[8]        = {
  39.         01, 02, 04, 010, 020, 040, 0100, 0200 };
  40. static unsigned long bigbyte[24] = {
  41.         0x800000L,      0x400000L,      0x200000L,      0x100000L,
  42.         0x80000L,       0x40000L,       0x20000L,       0x10000L,
  43.         0x8000L,        0x4000L,        0x2000L,        0x1000L,
  44.         0x800L,         0x400L,         0x200L,         0x100L,
  45.         0x80L,          0x40L,          0x20L,          0x10L,
  46.         0x8L,           0x4L,           0x2L,           0x1L    };
  47. /* Use the key schedule specified in the Standard (ANSI X3.92-1981). */
  48. static unsigned char pc1[56] = {
  49.         56, 48, 40, 32, 24, 16,  8,      0, 57, 49, 41, 33, 25, 17,
  50.          9,  1, 58, 50, 42, 34, 26,     18, 10,  2, 59, 51, 43, 35,
  51.         62, 54, 46, 38, 30, 22, 14,      6, 61, 53, 45, 37, 29, 21,
  52.         13,  5, 60, 52, 44, 36, 28,     20, 12,  4, 27, 19, 11,  3 };
  53. static unsigned char totrot[16] = {
  54.         1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 };
  55. static unsigned char pc2[48] = {
  56.         13, 16, 10, 23,  0,  4,  2, 27, 14,  5, 20,  9,
  57.         22, 18, 11,  3, 25,  7, 15,  6, 26, 19, 12,  1,
  58.         40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,
  59.         43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };
  60. void deskey(key, edf)   /* Thanks to James Gillogly & Phil Karn! */
  61. unsigned char *key;
  62. short edf;
  63. {
  64.         register int i, j, l, m, n;
  65.         unsigned char pc1m[56], pcr[56];
  66.         unsigned long kn[32];
  67.         for ( j = 0; j < 56; j++ ) {
  68.                 l = pc1[j];
  69.                 m = l & 07;
  70.                 pc1m[j] = (key[l >> 3] & bytebit[m]) ? 1 : 0;
  71.                 }
  72.         for( i = 0; i < 16; i++ ) {
  73.                 if( edf == DE1 ) m = (15 - i) << 1;
  74.                 else m = i << 1;
  75.                 n = m + 1;
  76.                 kn[m] = kn[n] = 0L;
  77.                 for( j = 0; j < 28; j++ ) {
  78.                         l = j + totrot[i];
  79.                         if( l < 28 ) pcr[j] = pc1m[l];
  80.                         else pcr[j] = pc1m[l - 28];
  81.                         }
  82.                 for( j = 28; j < 56; j++ ) {
  83.                     l = j + totrot[i];
  84.                     if( l < 56 ) pcr[j] = pc1m[l];
  85.                     else pcr[j] = pc1m[l - 28];
  86.                     }
  87.                 for( j = 0; j < 24; j++ ) {
  88.                         if( pcr[pc2[j]] ) kn[m] |= bigbyte[j];
  89.                         if( pcr[pc2[j+24]] ) kn[n] |= bigbyte[j];
  90.                         }
  91.                 }
  92.         cookey(kn);
  93.         return;
  94.         }
  95. static void cookey(raw1)
  96. register unsigned long *raw1;
  97. {
  98.         register unsigned long *cook, *raw0;
  99.         unsigned long dough[32];
  100.         register int i;
  101.         cook = dough;
  102.         for( i = 0; i < 16; i++, raw1++ ) {
  103.                 raw0 = raw1++;
  104.                 *cook    = (*raw0 & 0x00fc0000L) << 6;
  105.                 *cook   |= (*raw0 & 0x00000fc0L) << 10;
  106.                 *cook   |= (*raw1 & 0x00fc0000L) >> 10;
  107.                 *cook++ |= (*raw1 & 0x00000fc0L) >> 6;
  108.                 *cook    = (*raw0 & 0x0003f000L) << 12;
  109.                 *cook   |= (*raw0 & 0x0000003fL) << 16;
  110.                 *cook   |= (*raw1 & 0x0003f000L) >> 4;
  111.                 *cook++ |= (*raw1 & 0x0000003fL);
  112.                 }
  113.         usekey(dough);
  114.         return;
  115.         }
  116. void cpkey(into)
  117. register unsigned long *into;
  118. {
  119.         register unsigned long *from, *endp;
  120.         from = KnL, endp = &KnL[32];
  121.         while( from < endp ) *into++ = *from++;
  122.         return;
  123.         }
  124. void usekey(from)
  125. register unsigned long *from;
  126. {
  127.         register unsigned long *to, *endp;
  128.         to = KnL, endp = &KnL[32];
  129.         while( to < endp ) *to++ = *from++;
  130.         return;
  131.         }
  132. void des(inblock, outblock)
  133. unsigned char *inblock, *outblock;
  134. {
  135.         unsigned long work[2];
  136.         scrunch(inblock, work);
  137.         desfunc(work, KnL);
  138.         unscrun(work, outblock);
  139.         return;
  140.         }
  141. static void scrunch(outof, into)
  142. register unsigned char *outof;
  143. register unsigned long *into;
  144. {
  145.         *into    = (*outof++ & 0xffL) << 24;
  146.         *into   |= (*outof++ & 0xffL) << 16;
  147.         *into   |= (*outof++ & 0xffL) << 8;
  148.         *into++ |= (*outof++ & 0xffL);
  149.         *into    = (*outof++ & 0xffL) << 24;
  150.         *into   |= (*outof++ & 0xffL) << 16;
  151.         *into   |= (*outof++ & 0xffL) << 8;
  152.         *into   |= (*outof   & 0xffL);
  153.         return;
  154.         }
  155. static void unscrun(outof, into)
  156. register unsigned long *outof;
  157. register unsigned char *into;
  158. {
  159.         *into++ = (unsigned char) ((*outof >> 24) & 0xffL);
  160.         *into++ = (unsigned char) ((*outof >> 16) & 0xffL);
  161.         *into++ = (unsigned char) ((*outof >>  8) & 0xffL);
  162.         *into++ = (unsigned char)  (*outof++      & 0xffL);
  163.         *into++ = (unsigned char) ((*outof >> 24) & 0xffL);
  164.         *into++ = (unsigned char) ((*outof >> 16) & 0xffL);
  165.         *into++ = (unsigned char) ((*outof >>  8) & 0xffL);
  166.         *into   = (unsigned char)  (*outof        & 0xffL);
  167.         return;
  168.         }
  169. static unsigned long SP1[64] = {
  170.         0x01010400L, 0x00000000L, 0x00010000L, 0x01010404L,
  171.         0x01010004L, 0x00010404L, 0x00000004L, 0x00010000L,
  172.         0x00000400L, 0x01010400L, 0x01010404L, 0x00000400L,
  173.         0x01000404L, 0x01010004L, 0x01000000L, 0x00000004L,
  174.         0x00000404L, 0x01000400L, 0x01000400L, 0x00010400L,
  175.         0x00010400L, 0x01010000L, 0x01010000L, 0x01000404L,
  176.         0x00010004L, 0x01000004L, 0x01000004L, 0x00010004L,
  177.         0x00000000L, 0x00000404L, 0x00010404L, 0x01000000L,
  178.         0x00010000L, 0x01010404L, 0x00000004L, 0x01010000L,
  179.         0x01010400L, 0x01000000L, 0x01000000L, 0x00000400L,
  180.         0x01010004L, 0x00010000L, 0x00010400L, 0x01000004L,
  181.         0x00000400L, 0x00000004L, 0x01000404L, 0x00010404L,
  182.         0x01010404L, 0x00010004L, 0x01010000L, 0x01000404L,
  183.         0x01000004L, 0x00000404L, 0x00010404L, 0x01010400L,
  184.         0x00000404L, 0x01000400L, 0x01000400L, 0x00000000L,
  185.         0x00010004L, 0x00010400L, 0x00000000L, 0x01010004L };
  186. static unsigned long SP2[64] = {
  187.         0x80108020L, 0x80008000L, 0x00008000L, 0x00108020L,
  188.         0x00100000L, 0x00000020L, 0x80100020L, 0x80008020L,
  189.         0x80000020L, 0x80108020L, 0x80108000L, 0x80000000L,
  190.         0x80008000L, 0x00100000L, 0x00000020L, 0x80100020L,
  191.         0x00108000L, 0x00100020L, 0x80008020L, 0x00000000L,
  192.         0x80000000L, 0x00008000L, 0x00108020L, 0x80100000L,
  193.         0x00100020L, 0x80000020L, 0x00000000L, 0x00108000L,
  194.         0x00008020L, 0x80108000L, 0x80100000L, 0x00008020L,
  195.         0x00000000L, 0x00108020L, 0x80100020L, 0x00100000L,
  196.         0x80008020L, 0x80100000L, 0x80108000L, 0x00008000L,
  197.         0x80100000L, 0x80008000L, 0x00000020L, 0x80108020L,
  198.         0x00108020L, 0x00000020L, 0x00008000L, 0x80000000L,
  199.         0x00008020L, 0x80108000L, 0x00100000L, 0x80000020L,
  200.         0x00100020L, 0x80008020L, 0x80000020L, 0x00100020L,
  201.         0x00108000L, 0x00000000L, 0x80008000L, 0x00008020L,
  202.         0x80000000L, 0x80100020L, 0x80108020L, 0x00108000L };
  203. static unsigned long SP3[64] = {
  204.         0x00000208L, 0x08020200L, 0x00000000L, 0x08020008L,
  205.         0x08000200L, 0x00000000L, 0x00020208L, 0x08000200L,
  206.         0x00020008L, 0x08000008L, 0x08000008L, 0x00020000L,
  207.         0x08020208L, 0x00020008L, 0x08020000L, 0x00000208L,
  208.         0x08000000L, 0x00000008L, 0x08020200L, 0x00000200L,
  209.         0x00020200L, 0x08020000L, 0x08020008L, 0x00020208L,
  210.         0x08000208L, 0x00020200L, 0x00020000L, 0x08000208L,
  211.         0x00000008L, 0x08020208L, 0x00000200L, 0x08000000L,
  212.         0x08020200L, 0x08000000L, 0x00020008L, 0x00000208L,
  213.         0x00020000L, 0x08020200L, 0x08000200L, 0x00000000L,
  214.         0x00000200L, 0x00020008L, 0x08020208L, 0x08000200L,
  215.         0x08000008L, 0x00000200L, 0x00000000L, 0x08020008L,
  216.         0x08000208L, 0x00020000L, 0x08000000L, 0x08020208L,
  217.         0x00000008L, 0x00020208L, 0x00020200L, 0x08000008L,
  218.         0x08020000L, 0x08000208L, 0x00000208L, 0x08020000L,
  219.         0x00020208L, 0x00000008L, 0x08020008L, 0x00020200L };
  220. static unsigned long SP4[64] = {
  221.         0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,
  222.         0x00802080L, 0x00800081L, 0x00800001L, 0x00002001L,
  223.         0x00000000L, 0x00802000L, 0x00802000L, 0x00802081L,
  224.         0x00000081L, 0x00000000L, 0x00800080L, 0x00800001L,
  225.         0x00000001L, 0x00002000L, 0x00800000L, 0x00802001L,
  226.         0x00000080L, 0x00800000L, 0x00002001L, 0x00002080L,
  227.         0x00800081L, 0x00000001L, 0x00002080L, 0x00800080L,
  228.         0x00002000L, 0x00802080L, 0x00802081L, 0x00000081L,
  229.         0x00800080L, 0x00800001L, 0x00802000L, 0x00802081L,
  230.         0x00000081L, 0x00000000L, 0x00000000L, 0x00802000L,
  231.         0x00002080L, 0x00800080L, 0x00800081L, 0x00000001L,
  232.         0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,
  233.         0x00802081L, 0x00000081L, 0x00000001L, 0x00002000L,
  234.         0x00800001L, 0x00002001L, 0x00802080L, 0x00800081L,
  235.         0x00002001L, 0x00002080L, 0x00800000L, 0x00802001L,
  236.         0x00000080L, 0x00800000L, 0x00002000L, 0x00802080L };
  237. static unsigned long SP5[64] = {
  238.         0x00000100L, 0x02080100L, 0x02080000L, 0x42000100L,
  239.         0x00080000L, 0x00000100L, 0x40000000L, 0x02080000L,
  240.         0x40080100L, 0x00080000L, 0x02000100L, 0x40080100L,
  241.         0x42000100L, 0x42080000L, 0x00080100L, 0x40000000L,
  242.         0x02000000L, 0x40080000L, 0x40080000L, 0x00000000L,
  243.         0x40000100L, 0x42080100L, 0x42080100L, 0x02000100L,
  244.         0x42080000L, 0x40000100L, 0x00000000L, 0x42000000L,
  245.         0x02080100L, 0x02000000L, 0x42000000L, 0x00080100L,
  246.         0x00080000L, 0x42000100L, 0x00000100L, 0x02000000L,
  247.         0x40000000L, 0x02080000L, 0x42000100L, 0x40080100L,
  248.         0x02000100L, 0x40000000L, 0x42080000L, 0x02080100L,
  249.         0x40080100L, 0x00000100L, 0x02000000L, 0x42080000L,
  250.         0x42080100L, 0x00080100L, 0x42000000L, 0x42080100L,
  251.         0x02080000L, 0x00000000L, 0x40080000L, 0x42000000L,
  252.         0x00080100L, 0x02000100L, 0x40000100L, 0x00080000L,
  253.         0x00000000L, 0x40080000L, 0x02080100L, 0x40000100L };
  254. static unsigned long SP6[64] = {
  255.         0x20000010L, 0x20400000L, 0x00004000L, 0x20404010L,
  256.         0x20400000L, 0x00000010L, 0x20404010L, 0x00400000L,
  257.         0x20004000L, 0x00404010L, 0x00400000L, 0x20000010L,
  258.         0x00400010L, 0x20004000L, 0x20000000L, 0x00004010L,
  259.         0x00000000L, 0x00400010L, 0x20004010L, 0x00004000L,
  260.         0x00404000L, 0x20004010L, 0x00000010L, 0x20400010L,
  261.         0x20400010L, 0x00000000L, 0x00404010L, 0x20404000L,
  262.         0x00004010L, 0x00404000L, 0x20404000L, 0x20000000L,
  263.         0x20004000L, 0x00000010L, 0x20400010L, 0x00404000L,
  264.         0x20404010L, 0x00400000L, 0x00004010L, 0x20000010L,
  265.         0x00400000L, 0x20004000L, 0x20000000L, 0x00004010L,
  266.         0x20000010L, 0x20404010L, 0x00404000L, 0x20400000L,
  267.         0x00404010L, 0x20404000L, 0x00000000L, 0x20400010L,
  268.         0x00000010L, 0x00004000L, 0x20400000L, 0x00404010L,
  269.         0x00004000L, 0x00400010L, 0x20004010L, 0x00000000L,
  270.         0x20404000L, 0x20000000L, 0x00400010L, 0x20004010L };
  271. static unsigned long SP7[64] = {
  272.         0x00200000L, 0x04200002L, 0x04000802L, 0x00000000L,
  273.         0x00000800L, 0x04000802L, 0x00200802L, 0x04200800L,
  274.         0x04200802L, 0x00200000L, 0x00000000L, 0x04000002L,
  275.         0x00000002L, 0x04000000L, 0x04200002L, 0x00000802L,
  276.         0x04000800L, 0x00200802L, 0x00200002L, 0x04000800L,
  277.         0x04000002L, 0x04200000L, 0x04200800L, 0x00200002L,
  278.         0x04200000L, 0x00000800L, 0x00000802L, 0x04200802L,
  279.         0x00200800L, 0x00000002L, 0x04000000L, 0x00200800L,
  280.         0x04000000L, 0x00200800L, 0x00200000L, 0x04000802L,
  281.         0x04000802L, 0x04200002L, 0x04200002L, 0x00000002L,
  282.         0x00200002L, 0x04000000L, 0x04000800L, 0x00200000L,
  283.         0x04200800L, 0x00000802L, 0x00200802L, 0x04200800L,
  284.         0x00000802L, 0x04000002L, 0x04200802L, 0x04200000L,
  285.         0x00200800L, 0x00000000L, 0x00000002L, 0x04200802L,
  286.         0x00000000L, 0x00200802L, 0x04200000L, 0x00000800L,
  287.         0x04000002L, 0x04000800L, 0x00000800L, 0x00200002L };
  288. static unsigned long SP8[64] = {
  289.         0x10001040L, 0x00001000L, 0x00040000L, 0x10041040L,
  290.         0x10000000L, 0x10001040L, 0x00000040L, 0x10000000L,
  291.         0x00040040L, 0x10040000L, 0x10041040L, 0x00041000L,
  292.         0x10041000L, 0x00041040L, 0x00001000L, 0x00000040L,
  293.         0x10040000L, 0x10000040L, 0x10001000L, 0x00001040L,
  294.         0x00041000L, 0x00040040L, 0x10040040L, 0x10041000L,
  295.         0x00001040L, 0x00000000L, 0x00000000L, 0x10040040L,
  296.         0x10000040L, 0x10001000L, 0x00041040L, 0x00040000L,
  297.         0x00041040L, 0x00040000L, 0x10041000L, 0x00001000L,
  298.         0x00000040L, 0x10040040L, 0x00001000L, 0x00041040L,
  299.         0x10001000L, 0x00000040L, 0x10000040L, 0x10040000L,
  300.         0x10040040L, 0x10000000L, 0x00040000L, 0x10001040L,
  301.         0x00000000L, 0x10041040L, 0x00040040L, 0x10000040L,
  302.         0x10040000L, 0x10001000L, 0x10001040L, 0x00000000L,
  303.         0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L,
  304.         0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L };
  305. static void desfunc(block, keys)
  306. register unsigned long *block, *keys;
  307. {
  308.         register unsigned long fval, work, right, leftt;
  309.         register int round;
  310.         leftt = block[0];
  311.         right = block[1];
  312.         work = ((leftt >> 4) ^ right) & 0x0f0f0f0fL;
  313.         right ^= work;
  314.         leftt ^= (work << 4);
  315.         work = ((leftt >> 16) ^ right) & 0x0000ffffL;
  316.         right ^= work;
  317.         leftt ^= (work << 16);
  318.         work = ((right >> 2) ^ leftt) & 0x33333333L;
  319.         leftt ^= work;
  320.         right ^= (work << 2);
  321.         work = ((right >> 8) ^ leftt) & 0x00ff00ffL;
  322.         leftt ^= work;
  323.         right ^= (work << 8);
  324.         right = ((right << 1) | ((right >> 31) & 1L)) & 0xffffffffL;
  325.         work = (leftt ^ right) & 0xaaaaaaaaL;
  326.         leftt ^= work;
  327.         right ^= work;
  328.         leftt = ((leftt << 1) | ((leftt >> 31) & 1L)) & 0xffffffffL;
  329.         for( round = 0; round < 8; round++ ) {
  330.                 work  = (right << 28) | (right >> 4);
  331.                 work ^= *keys++;
  332.                 fval  = SP7[ work                & 0x3fL];
  333.                 fval |= SP5[(work >>  8) & 0x3fL];
  334.                 fval |= SP3[(work >> 16) & 0x3fL];
  335.                 fval |= SP1[(work >> 24) & 0x3fL];
  336.                 work  = right ^ *keys++;
  337.                 fval |= SP8[ work                & 0x3fL];
  338.                 fval |= SP6[(work >>  8) & 0x3fL];
  339.                 fval |= SP4[(work >> 16) & 0x3fL];
  340.                 fval |= SP2[(work >> 24) & 0x3fL];
  341.                 leftt ^= fval;
  342.                 work  = (leftt << 28) | (leftt >> 4);
  343.                 work ^= *keys++;
  344.                 fval  = SP7[ work                & 0x3fL];
  345.                 fval |= SP5[(work >>  8) & 0x3fL];
  346.                 fval |= SP3[(work >> 16) & 0x3fL];
  347.                 fval |= SP1[(work >> 24) & 0x3fL];
  348.                 work  = leftt ^ *keys++;
  349.                 fval |= SP8[ work                & 0x3fL];
  350.                 fval |= SP6[(work >>  8) & 0x3fL];
  351.                 fval |= SP4[(work >> 16) & 0x3fL];
  352.                 fval |= SP2[(work >> 24) & 0x3fL];
  353.                 right ^= fval;
  354.                 }
  355.         right = (right << 31) | (right >> 1);
  356.         work = (leftt ^ right) & 0xaaaaaaaaL;
  357.         leftt ^= work;
  358.         right ^= work;
  359.         leftt = (leftt << 31) | (leftt >> 1);
  360.         work = ((leftt >> 8) ^ right) & 0x00ff00ffL;
  361.         right ^= work;
  362.         leftt ^= (work << 8);
  363.         work = ((leftt >> 2) ^ right) & 0x33333333L;
  364.         right ^= work;
  365.         leftt ^= (work << 2);
  366.         work = ((right >> 16) ^ leftt) & 0x0000ffffL;
  367.         leftt ^= work;
  368.         right ^= (work << 16);
  369.         work = ((right >> 4) ^ leftt) & 0x0f0f0f0fL;
  370.         leftt ^= work;
  371.         right ^= (work << 4);
  372.         *block++ = right;
  373.         *block = leftt;
  374.         return;
  375.         }
  376. /* Validation sets:
  377.  *
  378.  * Single-length key, single-length plaintext -
  379.  * Key    : 0123 4567 89ab cdef
  380.  * Plain  : 0123 4567 89ab cde7
  381.  * Cipher : c957 4425 6a5e d31d
  382.  *
  383.  * Double-length key, single-length plaintext -
  384.  * Key    : 0123 4567 89ab cdef fedc ba98 7654 3210
  385.  * Plain  : 0123 4567 89ab cde7
  386.  * Cipher : 7f1d 0a77 826b 8aff
  387.  *
  388.  * Double-length key, double-length plaintext -
  389.  * Key    : 0123 4567 89ab cdef fedc ba98 7654 3210
  390.  * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff
  391.  * Cipher : 27a0 8440 406a df60 278f 47cf 42d6 15d7
  392.  *
  393.  * Triple-length key, single-length plaintext -
  394.  * Key    : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567
  395.  * Plain  : 0123 4567 89ab cde7
  396.  * Cipher : de0b 7c06 ae5e 0ed5
  397.  *
  398.  * Triple-length key, double-length plaintext -
  399.  * Key    : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567
  400.  * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff
  401.  * Cipher : ad0d 1b30 ac17 cf07 0ed1 1c63 81e4 4de5
  402.  *
  403.  * d3des V5.0a rwo 9208.07 18:44 Graven Imagery
  404.  **********************************************************************/