Translate to EnglishÜbersetzen Sie zum Deutsch/GermanΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/NorwegianÖversätta till Svensk/Swedishहिन्दी अनुवाद करने के लिए/Hindi
Tradueix al català/CatalanTulkot uz latviešu/LatvianPreložiť do slovenčiny/SlovakVertaal aan het Nederlands/Dutchترجمة الى العربية/ArabicTraduzca al Español/SpanishTraduisez au Français/French
Traduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese TraditionalПереклад на українську/Ukrainian
����������
��Google Maps���API 3
XSLT 2.0�XPath 2.0����(���������)��
�����UNIX�����(���-����������)���

OpenSSL DES APIs

OpenSSL 1.0.0OpenSSL ( ) (DES) OpenSSL DES

DESOpenSSLlibcrypto Tim 1995SSLeay (A eay) SSLeay SSLeayOpenSSL SSLeay RSA EMC

DES DES IBM Horst Feistel Lucifer 1977(NIST)46 (FIPS 46) DES

DES( ) NN DES64 DES

DES() FeistelFeistel Feistel DESFestel

Feistel��

DES(DEA) DEA (S-boxes) DEAS-boxes(Shannon `s) (16) cryptoanalysis 8DEA DEAS-boxes S-boxes DEA() DES5664 8(64)7 4856

DES FIPS 81 (DES)

(ECB)

  • 64()

(CBC)

  • 64

(CFB)

  • j <>
  • j
  • k (j == k)

(OFB)

  • j <>
  • j

DES ECB

  • key1key2key3
  • ECB168
  • 112
  • 3ECB

DES CBC

  • key1key2key3
  • CBC168DES ESB

DES DES_ecb_encrypt ()64(ECB) DES_ENCRYPT()()key_schedule DES_DECRYPT()()

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 64 

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;

    DES_cblock key;
    DES_cblock seed = {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
    DES_key_schedule keysched;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    RAND_seed(seed, sizeof(DES_cblock));

    DES_random_key(&key);

    DES_set_key((C_Block *)key, &keysched);

    /* 8 bytes of plaintext */
    strcpy(in, "HillTown");

    printf("Plaintext: [%s]\n", in);

    DES_ecb_encrypt((C_Block *)in,(C_Block *)out, &keysched, DES_ENCRYPT);

    printf("Ciphertext:");
    while (*e) printf(" [%02x]", *e++);
    printf("\n");

    DES_ecb_encrypt((C_Block *)out,(C_Block *)back, &keysched, DES_DECRYPT);

    printf("Decrypted Text: [%s]\n", back);

    return(0);
}


C_Block C_Block DES_cblockC_Blockdes_cblock DES_cblockdefintiontypedefDES_cblock [8]des.h


$ gcc -o example1 example1.c -lcrypto
$ ./example1
Plaintext: [HillTown]
Ciphertext: [34] [bc] [85] [30] [14] [95] [43] [00]
Decrypted Text: [HillTown]
$


DES DES_key_schedule DES8DES_cblock PRNG (RAND_seed ()) 64DES ; OpenSSL

DES FIPS-46DES

  • ()= Ek3(Dk2 (Ek1 ()))
  • EEE ()= Ek3(Ek2 (Ek1 (pliantext)))

EkDkDES ANSI X9.52DES

  • k1! = k2! = k3
  • k1! = k2 k1 = k3 k2! = k3
  • k1 = k2 = k3

DES backwardlyDES FIPS-46DES168EEE OpenSSL

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 1024

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    int i;

    DES_cblock key1, key2, key3;
    DES_cblock seed = {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
    DES_key_schedule ks1, ks2, ks3;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    RAND_seed(seed, sizeof(DES_cblock));

    DES_random_key(&key1);
    DES_random_key(&key2);
    DES_random_key(&key3);

    DES_set_key((C_Block *)key1, &ks1);
    DES_set_key((C_Block *)key2, &ks2);
    DES_set_key((C_Block *)key3, &ks3);

    /* 64 bytes of plaintext */
    strcpy(in, "Now is the time for all men to stand up and be counted");

    printf("Plaintext: [%s]\n", in);

    for (i = 0; i < 63; i += 8) {
        DES_ecb3_encrypt((C_Block *)(in + i),(C_Block *)(out + i), &ks1, &ks2, &ks3, DES_ENCRYPT);
    }

    printf("Ciphertext:");
    while (e++) printf(" [%02x]", *e++);
    printf("\n");

    for (i = 0; i < 63; i += 8) {
        DES_ecb3_encrypt((C_Block *)(out + i),(C_Block *)(back + i), &ks1, &ks2, &ks3, DES_DECRYPT);
    }

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}


(k1! = k2! = k3)DES

[fpm@ultra ~]$ ./example2
Plaintext: [Now is the time for all men to stand up and be counted]
Ciphertext: [b4] [31] [40] [aa] [41] [7d] [fc] [72] [4b] [f7] [46] [b5] [24] [83] [95] [03] [38] [1a] [50] [4e] [65] [5e] [83] [19] [b4] [0f] [74] [8b] [0c] [de] [5f] [34] [bf] [ee] [65] [4a] [b1] [0d] [33] [b4] [db] [cd] [02] [2c] [6c] [39] [7e] [57] [0d] [99] [18] [69] [23] [56] [fb] [00]
Decrypted Text: [Now is the time for all men to stand up and be counted]
[fpm@ultra ~]$


cipherblockXOR

initiallization (ivec) DES_cbc_encrypt ()DES_ncbc_encrypt ()libcrypto ncbc(n) OpenSSL DES

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 512 

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    int len;

    DES_cblock key;
    DES_cblock seed = {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
    DES_cblock ivsetup = {0xE1, 0xE2, 0xE3, 0xD4, 0xD5, 0xC6, 0xC7, 0xA8};
    DES_key_schedule keysched;
    DES_cblock ivec;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    RAND_seed(seed, sizeof(DES_cblock));

    DES_random_key(&key);
    DES_set_odd_parity(&key);
    if (DES_set_key_checked((C_Block *)key, &keysched))
    {
        fprintf(stderr, "ERROR: Unable to set key schedule\n");
        exit(1);
    }

    /* 64 bytes of plaintext */
    strcpy(in, "Now is the time for all men to stand up and be counted");

    printf("Plaintext: [%s]\n", in);

    len = strlen(in);
    memcpy(ivec, ivsetup, sizeof(ivsetup));
    DES_ncbc_encrypt(in, out, len, &keysched, &ivec, DES_ENCRYPT);

    printf("Ciphertext:");
    while (*e) printf(" [%02x]", *e++);
    printf("\n");

    memcpy(ivec, ivsetup, sizeof(ivsetup));
    DES_ncbc_encrypt(out, back, len, &keysched, &ivec, DES_DECRYPT);

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}


ivec ivec

DES_ede3_ncbc_encrypt ()CBC DES CBCDESC=E (ks3 D (ks2 E (ks1 M))) SSL

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 512 

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    int len;

    DES_cblock key1, key2, key3;
    DES_cblock seed = {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
    DES_cblock ivsetup = {0xE1, 0xE2, 0xE3, 0xD4, 0xD5, 0xC6, 0xC7, 0xA8};
    DES_cblock ivec;
    DES_key_schedule ks1, ks2, ks3;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    RAND_seed(seed, sizeof(DES_cblock));

    DES_random_key(&key1);
    DES_random_key(&key2);
    DES_random_key(&key3);

    DES_set_key((C_Block *)key1, &ks1);
    DES_set_key((C_Block *)key2, &ks2);
    DES_set_key((C_Block *)key3, &ks3);

    /* 64 bytes of plaintext */
    strcpy(in, "Now is the time for all men to stand up and be counted");

    printf("Plaintext: [%s]\n", in);

    len = strlen(in);
    memcpy(ivec, ivsetup, sizeof(ivsetup));
    DES_ede3_cbc_encrypt(in, out, len, &ks1, &ks2, &ks3, &ivec, DES_ENCRYPT);

    printf("Ciphertext:");
    while (*e) printf(" [%02x]", *e++);
    printf("\n");

    len = strlen(out);
    memcpy(ivec, ivsetup, sizeof(ivsetup));
    DES_ede3_cbc_encrypt(out, back, len, &ks1, &ks2, &ks3, &ivec, DES_DECRYPT);

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}


ivec 64

DES CBC 64DESDESXOR Apparantly Eli BihamLars Knudsen

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 512
#define CBCM_ONE

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    int len;

    DES_cblock key1, key2, key3;
    DES_cblock seed = {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
    DES_cblock ivecstr = {0xE1, 0xE2, 0xE3, 0xD4, 0xD5, 0xC6, 0xC7, 0xA8};
    DES_cblock ivec2, ivec1;
    DES_key_schedule ks1, ks2, ks3;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    RAND_seed(seed, sizeof(DES_cblock));

    DES_random_key(&key1);
    DES_random_key(&key2);
    DES_random_key(&key3);

    DES_set_key((C_Block *)key1, &ks1);
    DES_set_key((C_Block *)key2, &ks2);
    DES_set_key((C_Block *)key3, &ks3);

    /* 64 bytes of plaintext */
    strcpy(in, "Now is the time for all men to stand up and be counted");

    printf("Plaintext: [%s]\n", in);

    memcpy(ivec2, ivecstr, sizeof(ivecstr));
    memset(ivec1,'\0',sizeof(ivec2));
    len = strlen(in) + 1;

#ifdef CBCM_ONE
    DES_ede3_cbcm_encrypt(in, out, len, &ks1, &ks2, &ks3, &ivec2, &ivec1, DES_ENCRYPT);
#else
    DES_ede3_cbcm_encrypt(in, out, 16, &ks1, &ks2, &ks3, &ivec2, &ivec1, DES_ENCRYPT);
    DES_ede3_cbcm_encrypt(&in[16], &out[16],len-16, &ks1, &ks2, &ks3, &ivec2, &ivec1, DES_ENCRYPT);
#endif

    printf("Ciphertext:");
    while (*e) printf(" [%02x]", *e+);
    printf("\n");

    len = strlen(out) + 1;
    memcpy(ivec2, ivecstr, sizeof(ivecstr));
    memset(ivec1,'\0',sizeof(ivec2));

    DES_ede3_cbcm_encrypt(out, back, len, &ks1, &ks2, &ks3, &ivec2, &ivec1, DES_DECRYPT);

    printf("Decrypted Text: [%s]\n", back);

    exit(0);


showns

(CFB) 1 CFBCBC

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 256
#define CFBMODE 1

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    int len;

    DES_cblock key;
    DES_cblock seed = {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10};
    DES_cblock ivecstr = {0xE1, 0xE2, 0xE3, 0xD4, 0xD5, 0xC6, 0xC7, 0xA8};
    DES_cblock ivec;
    DES_key_schedule ks;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    RAND_seed(seed, sizeof(DES_cblock));

    DES_random_key(&key);
    DES_set_key((C_Block *)key, &ks);

    /* 11 bytes of plaintext */
    strcpy(in, "Philippines");

    printf("Plaintext: [%s]\n", in);

    memcpy(ivec, ivecstr, sizeof(ivecstr));
    len = strlen(in);

    DES_cfb_encrypt(in, out, CFBMODE, len, &ks, &ivec, DES_ENCRYPT);

    printf("Ciphertext:");
    while (*e) printf(" [%02x]", *e+);
    printf("\n");

    len = strlen(out);
    memcpy(ivec, ivecstr, sizeof(ivecstr));

    DES_cfb_encrypt(out, back, CFBMODE, len, &ks, &ivec, DES_DECRYPT);

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}


CBF64DESASCII

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>

#define BUFSIZE 256 

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    int len;
    int n = 0;

    static char *keystr = "0123456789abcdef";
    static char *ivecstr = "0123456789abcdef";

    DES_cblock ivec;
    DES_key_schedule ks;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    strcpy(in,"Now is the time for all.");
    DES_set_key((C_Block *)keystr, &ks);

    printf("Plaintext: [%s]\n", in);

    memcpy(ivec, (C_Block *)ivecstr, sizeof(ivec));
    len = strlen(in) + 1;

    DES_cfb64_encrypt(in, out, len, &ks, &ivec, &n, DES_ENCRYPT);

    printf("Ciphertext:");
    while (*e) printf(" [%02x]", *e++);
    printf("\n");

    memcpy(ivec, (C_Block *)ivecstr, sizeof(ivec));

    DES_cfb64_encrypt(out, back, len, &ks, &ivec, &n, DES_DECRYPT);

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}


DES_string_to_key () DES_set_odd_parity16.DES_string_to_key ()()

8OFB OpenSSL numbitsDESnumbits8

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>
#include <openssl/rand.h>

#define BUFSIZE 256 

int main(void)
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    unsigned char *e = out;
    char *keystr = "Philippines06235";
    int len, n, result;

    DES_cblock key;
    DES_cblock ivecstr = {0xE1, 0xE2, 0xE3, 0xD4, 0xD5, 0xC6, 0xC7, 0xA8};
    DES_cblock ivec;
    DES_key_schedule ks;

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    DES_string_to_key(keystr, &key);

    if ((result = DES_set_key_checked((C_Block *)key, &ks)) != 0) {
        if (result == -1) {
            printf("ERROR: key parity is incorrect\n");
        } else {
            printf("ERROR: weak or semi-weak key\n");
        }
        exit(1);
    }

    strcpy(in,"The Chocolate Hills of Bohol are wonderful.");

    printf("Plaintext: [%s]\n", in);

    memcpy(ivec, ivecstr, sizeof(ivecstr));
    len = strlen(in);
    printf("Plaintext Length: %d\n", len);

    DES_ofb_encrypt(in, out, 8, len, &ks, &ivec);

    n = 0;
    printf("Ciphertext:");
    while (*e) {
        printf(" [%02x]", *e++);
        n++;
    }
    printf("\n");
    printf("Ciphertext Length: %d\n", n);

    len = strlen(out);
    memcpy(ivec, ivecstr, sizeof(ivecstr));

    DES_ofb_encrypt(out, back, 8, len, &ks, &ivec);

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}


ede3_ofb64_encrypt () k1 = k2 = k3 k1! = k2! = k3

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/des.h>

#define BUFSIZE 1024 

int main(int argc, char *argv[])
{
    unsigned char in[BUFSIZE], out[BUFSIZE], back[BUFSIZE];
    char buf[201];
    char *keystr = "Victoria Harbour";
    unsigned char *e = out;
    FILE *fin;
    int i, num, len, result;
    int n = 0;

    DES_cblock key;
    DES_cblock ivsetup = {0xE1, 0xE2, 0xE3, 0xD4, 0xD5, 0xC6, 0xC7, 0xA8};
    DES_key_schedule ks;
    DES_cblock ivec;

    if (argc != 2) {
        printf("ERROR: plaintext filename required\n");
        exit(1);
    }

    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    memset(back, 0, sizeof(back));

    DES_string_to_key(keystr, &key);

    if ((result = DES_set_key_checked((C_Block *)key, &ks)) != 0) {
        if (result == -1) {
            printf("ERROR: key parity is incorrect\n");
        } else {
            printf("ERROR: weak or semi-weak key\n");
        }
        exit(1);
    }

    fin = fopen(argv[1], "r");
    if (!fin) {
        printf(" ERROR: opening input file\n");
        exit(1);
    }
    while(fgets(buf, 200, fin) != NULL) {
        strcat(in, buf);
    }
    fclose(fin);

    printf("Plaintext: [%s]\n", in);
    len = strlen(in);
    printf("Plaintext Length: %d\n", len);

    memcpy(ivec, ivsetup, sizeof(ivsetup));
    num = 0;
    for (i = 0; i < len; i++) {
        DES_ede3_ofb64_encrypt(&(in[i]), &(out[i]), 1, &ks, &ks, &ks, &ivec, &num);
    }

    n = 0;
    printf("Ciphertext:");
    while (*e) {
        printf(" [%02x]", *e++);
        n++;
    }
    printf("\n");
    printf("Ciphertext Length: %d\n", n);

    memcpy(ivec, ivsetup, sizeof(ivsetup));
    num = 0;
    for (i = 0; i < len; i++) {
        DES_ede3_ofb64_encrypt(&(out[i]), &(back[i]), 1, &ks, &ks, &ks, &ivec, &num);
    }

    printf("Decrypted Text: [%s]\n", back);

    exit(0);
}



$ echo -n "Now is the time to finish this post" > plaintext
$ ./example9 plaintext
Plaintext: [Now is the time to finish this post]
Plaintext Length: 35
Ciphertext: [92] [cb] [29] [fe] [aa] [94] [d7] [ba] [07] [a5] [8f] [78] [4f] [13] [fa] [c4] [4f] [22] [0d] [fd] [b7] [33] [81] [3e] [3a] [e4] [f5] [c6] [52] [c9] [2b] [4f] [d5] [b8] [00]
Ciphertext Length: 35
Decrypted Text: [Now is the time to finish this post]
$

OpenSSL v1.0 DES des_DES DES_libcrypto DES_ DES_

DES DESStinson3Crytography(0-8493-8521-0) CSchneir(0-471-59756-2) OpenSSLlibcrypto DES../crypto/des

!

OpenSSL DES APIs10

  • nguyenthaithuan

    OpenSLL
    !!!

    NguyenThuan
    Sai Gon

  • Ivan



    !
    funcs (DES_ecb3_encrypt)OS
    Solaris (SunOS 5.10) Linux 32,64UbuntuCentos

    OS

    1. openssl( )
    2.
    (DES
    DES_key_scheduleDES_set_key_checked ()DES_set_key_unchecked () )

    DES_ecb3_encryptDES_set_key_unchecked ()k1 k2 k3C

    Ivan

  • Ivan

    OfcoursealgDES_ecb3_encrypt
    ()

    Ivan

  • Ivan

    )
    )
    ofcourse)))
    DES_set_key_unchecked
    enc12

    Ivan

  • DES3DESopenssl


    (des.c)

    e
    0
    NUL
    NUL

    DES_CblockDES_ecb_encrypt(C_Block *) C_blockDES_Cblock

    64DES64

    DES_set_keyDES_set_key_checked

    8DES_random_key8 (prng)

  • (*e++) !

    DES_CblockDES_cblock DES_cblockdes_cblockC_Block C_Block

    BUFSIZE HillTown91BUFSIZE9 DES internals

    DES_set_key ()DES_set_key_checkedi () DES_set_key_checked-DES_set_key API API

  • Zack

    OpenSSL

  • yuna


    int newTextLength = newText.length (); /no.2 - >no.1
    (int= 0; < lenOrgTxt; += 8)
    {
    DES_ecb3_encrypt ((DES_cblock *) (unsignedCharTextForEncrypt+i) (DES_cblock* (encryDES+i)
    &keySched1&keySched2&keySched1 DES_ENCRYPT);
    }

    120
    120(128 256)! encryDES36!

    120

  • Kedar Sabnis

    DES_ecb3_encrypt

    Imate@005 Key1 = [MATRIXSE] Key2 = []Imate@005 Key3 = []decypt

    pls

    int TDES_Decrypt (*sCipher*sKey*sPlainText)
    {
    fplog = fopen (3DES1.log a ");
    fprintf (fplog \ n \ n \ n .................. TDES_Decrypt .......................... \ n ");
    fprintf (fplog \ n [%s] [%d] ...... sCipher strlen (sCipher));
    fprintf (fplog \ n [%s] [%d] ....... sKey strlen (sKey));

    int iRetVal=0;
    SessionKeyFE [KEY_LEN_SESSION];

    DES_cblock key1;
    DES_cblock key2;
    DES_cblock key3;
    DES_cblock inBuffer;
    DES_cblock tempBuffer;

    DES_key_schedule *ks1;
    DES_key_schedule *ks2;
    DES_key_schedule *ks3;

    memcpy (SessionKeyFE sKey KEY_LEN_SESSION);

    memset (&key1 `DES_KEY_SZ);
    memcpy (&key1 &SessionKeyFE [0] DES_KEY_SZ);
    fprintf (fplog\ n1 [%s] [%d] key1 strlen (key1));

    memset (&key2 `DES_KEY_SZ);
    memcpy (&key2 &SessionKeyFE [8] DES_KEY_SZ);
    fprintf (fplog\ n2 [%s] [%d] ...... key2 strlen (key2));

    memset (&key3 `DES_KEY_SZ);
    memcpy (&key3 &SessionKeyFE [16] DES_KEY_SZ);
    fprintf (fplog\ n3 [%s] [%d] key3 strlen (key3));

    ks1= (*) malloc (DES_SCHEDULE_SZ);
    DES_set_key_unchecked (key1 ks1);

    ks2= (*) malloc (DES_SCHEDULE_SZ);
    DES_set_key_unchecked (key2 ks2);

    ks3= (*) malloc (DES_SCHEDULE_SZ);
    DES_set_key_unchecked (key3 ks3);

    memset (&inBuffer `DES_KEY_SZ);
    memset (&tempBuffer `DES_KEY_SZ);

    fprintf (fplog \ n \ n DES_KEY_SZ = [%d] \ n DES_KEY_SZ);

    memcpy (&inBuffer sCipher DES_KEY_SZ);
    fprintf (fplog \ n \ inBuffern ............ [%s] [%d] ...... inBuffer strlen (inBuffer));
    DES_ecb3_encrypt (&inBuffer &tempBuffer ks1ks2ks3 DES_DECRYPT);
    memcpy (sPlainText &tempBuffer DES_KEY_SZ);
    fprintf (fplog \n____1 [%s] [%d]. sPlainText strlen (sPlainText));

    memset (&inBuffer `DES_KEY_SZ+1);
    memset (&tempBuffer `DES_KEY_SZ+1);

    memcpy (&inBuffer sCipher + 8 DES_KEY_SZ);
    fprintf (fplog \ n \ inBuffern ............ [%s] [%d] ...... inBuffer strlen (inBuffer));
    DES_ecb3_encrypt (&inBuffer &tempBuffer ks1ks2ks3 DES_DECRYPT);
    memcpy (sPlainText + 8 &tempBuffer DES_KEY_SZ);
    fprintf (fplog \n____2 [%s] [%d]. tempBuffer strlen (tempBuffer));
    fprintf (fplog \ n____ [%s] [%d]. sPlainText strlen (sPlainText));

    (ks1); (ks2); (ks3);
    fclose (fplog);
    iRetVal;
    }