This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DK-TM4C129X: How to print each rounds of the CBC single DES encrypt/decrypt using TM4c129x?

Part Number: DK-TM4C129X

Hello Team,

I'm posting on behalf of my customer:

Hi so i know we have to use DESConfigSet(DES_BASE, DES_CFG_DIR_ENCRYPT | DES_CFG_MODE_CBC | DES_CFG_SINGLE) to set up the encryption process of the DES module and DESDataProcess(DES_BASE, EnDESPlainText, DESCipherText, 64) to directly get the cipher text. My question is there a way to check what is printed out after each round of the DES function? 

Regards,

Renan

  • Hello Renan,

    I'm not entirely sure what they mean by 'each round of the DES function' but the final results would be within the DESCipherText array.

    The function description in TivaWare outlines that the third input is the pointer for an array of words where the processed data will be placed.

    //*****************************************************************************
    //
    //! Processes blocks of data through the DES module.
    //!
    //! \param ui32Base is the base address of the DES module.
    //! \param pui32Src is a pointer to an array of words that contains the
    //! source data for processing.
    //! \param pui32Dest is a pointer to an array of words consisting of the
    //! processed data.
    //! \param ui32Length is the length of the cryptographic data in bytes.
    //! It must be a multiple of eight.
    //!
    //! This function takes the data contained in the pui32Src array and processes
    //! it using the DES engine.  The resulting data is stored in the
    //! pui32Dest array.  The function blocks until all of the data has been
    //! processed.  If processing is successful, the function returns true.
    //!
    //! \note This functions assumes that the DES module has been configured,
    //! and initialization values and keys have been written.
    //!
    //! \return true or false.
    //
    //*****************************************************************************
    bool
    DESDataProcess(uint32_t ui32Base, uint32_t *pui32Src, uint32_t *pui32Dest,
                   uint32_t ui32Length)

    Best Regards,

    Ralph Jacobi

  • Hello Ralph,

    Thank you for your reply.Please see my customer feedback below:

    When i mentioned the DES rounds I meant for the 16 rounds of the DES process. The DESDataProcess() only output the array after 16 rounds have completed. What I want to ask is how can you check what output after just 1 round?

    Regards,

    Renan

  • Hello Renan,

    There isn't a way to do that with the hardware accelerated DES peripheral. They would need to implement a software version of the DES encryption to check the data between the 16 rounds.

    Best Regards,

    Ralph Jacobi