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.

[参考译文] LP-AM263P:AES 加密在线计算器

Guru**** 2373240 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1532105/lp-am263p-aes-encryption-online-calculator

器件型号:LP-AM263P

工具/软件:

尊敬的团队:  

 我提到了 4 到 5 在线计算器的 AES 128 CBC 加密,他们没有一个匹配的结果中提供的 AES 示例代码中提供的 MCU_PLUS_SDK . 所以,我需要 AES CBC 128 位加密在线计算器,它应该与我们的示例代码结果匹配。

此致、  
K.Sravya.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我使用了 crypto_AES_CBC_128.c 中的纯文本、密钥和 IV:

    /* Input buffer for encryption or decryption */
    static uint8_t gCryptoAesCbc128PlainText[APP_CRYPTO_AES_CBC_128_INOUT_LENGTH] __attribute__ ((aligned (APP_CRYPTO_AES_CBC_128_CATCHE_ALIGNMENT))) =
    {
        0x98, 0x3B, 0xF6, 0xF5, 0xA6, 0xDF, 0xBC, 0xDA,
        0xA1, 0x93, 0x70, 0x66, 0x6E, 0x83, 0xA9, 0x9A
    };
    
    /* The AES algorithm encrypts and decrypts data in blocks of 128 bits. It can do this using 128-bit or 256-bit keys */
    static uint8_t gCryptoAesCbc128Key[APP_CRYPTO_AES_CBC_128_KEY_LENGTH_IN_BYTES] __attribute__ ((aligned (APP_CRYPTO_AES_CBC_128_CATCHE_ALIGNMENT))) =
    {
        0x93, 0x28, 0x67, 0x64, 0xA8, 0x51, 0x46, 0x73,
        0x0E, 0x64, 0x18, 0x88, 0xDB, 0x34, 0xEB, 0x47
    };
    
    /* Initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption/decryption. */
    static uint8_t gCryptoAesCbc128Iv[APP_CRYPTO_AES_CBC_128_IV_LENGTH_IN_BYTES] __attribute__ ((aligned (APP_CRYPTO_AES_CBC_128_CATCHE_ALIGNMENT))) =
    {
        0x19, 0x2D, 0x9B, 0x3A, 0xA1, 0x0B, 0xB2, 0xF7,
        0x84, 0x6C, 0xCB, 0xA0, 0x08, 0x5C, 0x65, 0x7A
    };

    我在此处输入:

    AES 加密:在线加密和解密 — 加密

    它与此处的加密文本匹配:

    /* Encrypted buffer of gCryptoAesCbc128PlainText */
    static uint8_t gCryptoAesCbc128CipherText[APP_CRYPTO_AES_CBC_128_INOUT_LENGTH] __attribute__ ((aligned (APP_CRYPTO_AES_CBC_128_CATCHE_ALIGNMENT))) =
    {
        0x28, 0x33, 0xdc, 0xc7, 0x24, 0xdc, 0x6a, 0xff,
        0x5a, 0x72, 0xe4, 0x3d, 0xdf, 0xb6, 0x63, 0x35
    };
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Sravya:

    在您使用的在线计算器中、IV(初始化矢量)是否与您尝试在 SDK 中使用的计算器相同? 我们有内部测试套件来确保加密按照 AES 标准进行。

    此外、输出格式和填充是否相同? (十六进制,base64 等)

    感谢 Kier 的 快速响应!

    此致、
    Shaunak