{
    "mode": "man",
    "parameter": "des_modes",
    "section": "7ssl",
    "url": "https://www.chedong.com/phpMan.php/man/des_modes/7ssl/json",
    "generated": "2026-10-05T14:28:29Z",
    "sections": {
        "NAME": {
            "content": "desmodes - the variants of DES and other crypto algorithms of OpenSSL\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Several crypto algorithms for OpenSSL can be used in a number of modes.  Those are used for\nusing block ciphers in a way similar to stream ciphers, among other things.\n",
            "subsections": []
        },
        "OVERVIEW": {
            "content": "",
            "subsections": [
                {
                    "name": "Electronic Codebook Mode (ECB)",
                    "content": "Normally, this is found as the function algorithmecbencrypt().\n\n• 64 bits are enciphered at a time.\n\n• The order of the blocks can be rearranged without detection.\n\n• The  same  plaintext  block  always  produces  the same ciphertext block (for the same key)\nmaking it vulnerable to a 'dictionary attack'.\n\n• An error will only affect one ciphertext block.\n"
                },
                {
                    "name": "Cipher Block Chaining Mode (CBC)",
                    "content": "Normally,  this  is  found  as  the  function   algorithmcbcencrypt().    Be   aware   that\ndescbcencrypt()  is  not really DES CBC (it does not update the IV); use desncbcencrypt()\ninstead.\n\n• a multiple of 64 bits are enciphered at a time.\n\n• The CBC mode produces the same ciphertext whenever the same plaintext  is  encrypted  using\nthe same key and starting variable.\n\n• The  chaining  operation  makes  the  ciphertext  blocks  dependent  on the current and all\npreceding plaintext blocks and therefore blocks can not be rearranged.\n\n• The use of different starting variables prevents the same plaintext enciphering to the same\nciphertext.\n\n• An error will affect the current and the following ciphertext blocks.\n"
                },
                {
                    "name": "Cipher Feedback Mode (CFB)",
                    "content": "Normally, this is found as the function algorithmcfbencrypt().\n\n• a number of bits (j) <= 64 are enciphered at a time.\n\n• The CFB mode produces the same ciphertext whenever the same plaintext  is  encrypted  using\nthe same key and starting variable.\n\n• The  chaining  operation  makes  the  ciphertext variables dependent on the current and all\npreceding variables and therefore j-bit variables are  chained  together  and  can  not  be\nrearranged.\n\n• The use of different starting variables prevents the same plaintext enciphering to the same\nciphertext.\n\n• The  strength  of  the  CFB  mode  depends  on  the  size  of k (maximal if j == k).  In my\nimplementation this is always the case.\n\n• Selection of a small value  for  j  will  require  more  cycles  through  the  encipherment\nalgorithm per unit of plaintext and thus cause greater processing overheads.\n\n• Only multiples of j bits can be enciphered.\n\n• An error will affect the current and the following ciphertext variables.\n"
                },
                {
                    "name": "Output Feedback Mode (OFB)",
                    "content": "Normally, this is found as the function algorithmofbencrypt().\n\n• a number of bits (j) <= 64 are enciphered at a time.\n\n• The  OFB mode produces the same ciphertext whenever the same plaintext enciphered using the\nsame key and starting variable.  More over, in the OFB mode the same key stream is produced\nwhen the same key and start variable  are  used.   Consequently,  for  security  reasons  a\nspecific start variable should be used only once for a given key.\n\n• The absence of chaining makes the OFB more vulnerable to specific attacks.\n\n• The  use of different start variables values prevents the same plaintext enciphering to the\nsame ciphertext, by producing different key streams.\n\n• Selection of a small value  for  j  will  require  more  cycles  through  the  encipherment\nalgorithm per unit of plaintext and thus cause greater processing overheads.\n\n• Only multiples of j bits can be enciphered.\n\n• OFB  mode of operation does not extend ciphertext errors in the resultant plaintext output.\nEvery bit error in the ciphertext causes only one bit to be  in  error  in  the  deciphered\nplaintext.\n\n• OFB  mode is not self-synchronizing.  If the two operation of encipherment and decipherment\nget out of synchronism, the system needs to be re-initialized.\n\n• Each re-initialization should use a value of the start variable different  from  the  start\nvariable  values  used  before with the same key.  The reason for this is that an identical\nbit stream would be produced each time from the same parameters.  This would be susceptible\nto a 'known plaintext' attack.\n"
                },
                {
                    "name": "Triple ECB Mode",
                    "content": "Normally, this is found as the function algorithmecb3encrypt().\n\n• Encrypt with key1, decrypt with key2 and encrypt with key3 again.\n\n• As for ECB encryption but increases the key  length  to  168  bits.   There  are  theoretic\nattacks  that can be used that make the effective key length 112 bits, but this attack also\nrequires 2^56 blocks of memory, not very likely, even for the NSA.\n\n• If both keys are the same it is equivalent to encrypting once with just one key.\n\n• If the first and last key are the same, the key length is 112 bits.  There are attacks that\ncould reduce the effective key strength to only slightly  more  than  56  bits,  but  these\nrequire a lot of memory.\n\n• If all 3 keys are the same, this is effectively the same as normal ecb mode.\n"
                },
                {
                    "name": "Triple CBC Mode",
                    "content": "Normally, this is found as the function algorithmede3cbcencrypt().\n\n• Encrypt with key1, decrypt with key2 and then encrypt with key3.\n\n• As  for  CBC encryption but increases the key length to 168 bits with the same restrictions\nas for triple ecb mode.\n"
                }
            ]
        },
        "NOTES": {
            "content": "This text was been written in large parts by Eric Young in  his  original  documentation  for\nSSLeay, the predecessor of OpenSSL.  In turn, he attributed it to:\n\nAS 2805.5.2\nAustralian Standard\nElectronic funds transfer - Requirements for interfaces,\nPart 5.2: Modes of operation for an n-bit block cipher algorithm\nAppendix A\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "BFencrypt(3), DEScrypt(3)\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed  under  the Apache License 2.0 (the \"License\").  You may not use this file except in\ncompliance with the License.  You can obtain a  copy  in  the  file  LICENSE  in  the  source\ndistribution or at <https://www.openssl.org/source/license.html>.\n\n3.0.13                                       2026-07-29                              DESMODES(7SSL)",
            "subsections": []
        }
    },
    "summary": "desmodes - the variants of DES and other crypto algorithms of OpenSSL",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "BFencrypt",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/BFencrypt/3/json"
        },
        {
            "name": "DEScrypt",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/DEScrypt/3/json"
        }
    ]
}