一 什么是 MD5?
MD5(Message-Digest Algorithm 5)是一種常用的哈希函數(shù),通常用于數(shù)據(jù)加密和安全校驗(yàn)等場合。MD5 算法可以將任意長度的消息輸入計(jì)算出一個(gè)固定長度的摘要,其生成的摘要具有唯一性和不可逆性,因此在一些場景下可以用來驗(yàn)證數(shù)據(jù)的完整性和真實(shí)性。本篇文章將詳細(xì)介紹 MD5 算法的概念、原理、應(yīng)用以及安全性問題。
MD5 是 Ronald Rivest 在1991年設(shè)計(jì)出來的一種哈希函數(shù),其輸入可以是任意長度的消息,輸出則固定為128位。MD5 的全稱是“Message-Digest Algorithm 5”,是 MD2 和 MD4 的改進(jìn)版本。與前者相比,MD5 可以處理更大的消息,并且經(jīng)過增加輔助函數(shù)和處理流程,其安全性也得到了進(jìn)一步提高。
MD5 算法的核心思想是將任意長度的消息輸入到一個(gè)壓縮函數(shù)中,該函數(shù)通過一系列變換將消息轉(zhuǎn)換成固定長度(128位)的消息摘要。由于函數(shù)中使用了大量的非線性變換操作,因此即使輸入的消息相差只有一位,其輸出的摘要也會(huì)發(fā)生很大的變化,這使得 MD5 算法在密碼學(xué)、數(shù)字簽名等領(lǐng)域中被廣泛應(yīng)用。
二 MD5的工作原理
附加填充:首先,MD5算法會(huì)對(duì)輸入數(shù)據(jù)進(jìn)行填充,使其長度達(dá)到512位的倍數(shù)(即64字節(jié)的倍數(shù))。填充的方式是在原始數(shù)據(jù)后添加一個(gè)1,然后添加足夠多的0,直到滿足長度要求。
初始化緩沖區(qū):MD5算法使用四個(gè)32位整數(shù)(A, B, C, D)作為緩沖區(qū),這四個(gè)整數(shù)被稱為鏈接變量(Chaining Variables)。這些變量在開始處理數(shù)據(jù)之前被初始化為特定的值。
處理數(shù)據(jù)塊:算法將數(shù)據(jù)劃分為512位(64字節(jié))的塊,并逐一處理這些塊。對(duì)于每個(gè)數(shù)據(jù)塊,算法執(zhí)行四輪操作(每輪64次迭代),每輪操作都會(huì)更新鏈接變量的值。
生成摘要:當(dāng)所有數(shù)據(jù)塊都被處理后,算法將鏈接變量的值作為最終的消息摘要輸出。這個(gè)摘要是一個(gè)128位的值,通常以32個(gè)十六進(jìn)制數(shù)的形式表示。
三 MD5編碼的特點(diǎn)
確定性:對(duì)于相同的輸入數(shù)據(jù),MD5算法總是生成相同的輸出摘要。
雪崩效應(yīng):MD5算法對(duì)輸入數(shù)據(jù)的微小變化非常敏感,即使只有一個(gè)比特位的改變,也會(huì)導(dǎo)致輸出摘要的顯著變化。
單向性:MD5算法是單向的,即無法從摘要中恢復(fù)出原始數(shù)據(jù)。
計(jì)算效率:MD5算法在計(jì)算上相對(duì)高效,可以在短時(shí)間內(nèi)處理大量數(shù)據(jù)。
四 MD5應(yīng)用場景
1、校驗(yàn)文件的完整性
如果張三給李四傳了一個(gè)文件,如何確認(rèn)這個(gè)文件傳給李四是完整的呢
張三傳文件前,先對(duì)文件做一個(gè)MD5加密,同時(shí)把MD5加密的密文傳給李四
李四收到文件,也對(duì)該文件做MD5加密,如果得到的密文和張三給的密文一樣,就說明文件是完整的。
2、存儲(chǔ)用戶密碼
用戶密碼,理論上也不能直接明文存儲(chǔ)在數(shù)據(jù)庫中,因?yàn)橐坏?shù)據(jù)庫被破解,用戶的密碼就全部丟失了
所以可以將用戶密碼做一個(gè)MD5加密,然后將密文存在數(shù)據(jù)庫中
用戶登錄的時(shí)候,可以將用戶的密碼進(jìn)行MD5加密,然后比對(duì)密文和數(shù)據(jù)庫中的密文是否一致,來判斷用戶前臺(tái)填的密碼是否正確。
這只是一個(gè)思路,一般不會(huì)這么簡單,一般生產(chǎn)環(huán)境會(huì)對(duì)用戶密碼加鹽加密等等的處理,用戶信息更加重要的,則需要更加復(fù)雜的計(jì)算邏輯。
五 MD5的原理
MD5以512位分組來處理輸入的信息,且每一分組又被劃分為16個(gè)32位子分組,經(jīng)過一些列的處理后,算法輸出由四個(gè)32位分組組成的128位散列值。具體的步驟如下所示:
1、填充
如果輸入信息的長度(bit)對(duì)512求余的結(jié)果不等于448,就需要填充使得對(duì)512求余結(jié)果等于448。填充的方法是填充一個(gè)1和n個(gè)0。填充完成后,信息的長度為N*512+448
2、記錄信息長度
用64位內(nèi)存來存儲(chǔ)填充前信息長度。這64位加在第一步結(jié)果的后面,這樣信息長度就變?yōu)镹*512 + 448 + 64 = (N+1)*512
3、裝入標(biāo)準(zhǔn)的幻數(shù)(四個(gè)整數(shù))
標(biāo)準(zhǔn)的幻數(shù)(物理順序)是(A=(01234567)16,B=(89ABCDEF)16,C=(FEDCBA98)16,D=(76543210)16)。如果在程序中定義應(yīng)該是(A=0X67452301L,B=0XEFCDAB89L,C=0X98BADCFEL,D=0X10325476L)。有點(diǎn)暈哈,其實(shí)想一想就明白了。
首先清楚整型的位表示方法,其次標(biāo)準(zhǔn)文檔上要求的是:四個(gè)幻數(shù)在內(nèi)存地址上從低到高為:
A: 01 23 45 67
B: 89 ab cd ef
C: fe dc ba 98
D: 76 54 32 10
采用小端表示法表示為A=0X67452301L,則在地址中就是A=01 23 45 67
4、循環(huán)運(yùn)算
4.1、把消息分以512位為一分組進(jìn)行處理
4.2、每一個(gè)分組進(jìn)行4輪變換,以上面所說4個(gè)標(biāo)準(zhǔn)的幻數(shù)為起始變量進(jìn)行計(jì)算,重新輸出4個(gè)變量
4.3、以這4個(gè)變量再進(jìn)行下一分組的運(yùn)算,如果已經(jīng)是最后一個(gè)分組,則這4個(gè)變量為最后的結(jié)果,即MD5值。
由上面的介紹,我們知道需要對(duì)(N+1)組數(shù)據(jù)進(jìn)行處理,所以要循環(huán)N+1次,每次的循環(huán)執(zhí)行下面的步驟:
將每一512字節(jié)細(xì)分成16個(gè)小組,每個(gè)小組32位(4個(gè)字節(jié))
認(rèn)識(shí)一下四個(gè)線性函數(shù)
F(X,Y,Z)=(X&Y)|((~X)&Z)
G(X,Y,Z)=(X&Z)|(Y&(~Z))
H(X,Y,Z)=XYZ
I(X,Y,Z)=Y^(X|(~Z))
設(shè)置Mj表示消息的第j個(gè)子分組(從0到15), <<< s 表示循環(huán)左移s位,則四種操作為:
FF(a,b,c,d,Mj,s,ti)表示a=b+((a+F(b,c,d)+Mj+ti)<<
GG(a,b,c,d,Mj,s,ti)表示a=b+((a+G(b,c,d)+Mj+ti)<<
HH(a,b,c,d,Mj,s,ti)表示a=b+((a+H(b,c,d)+Mj+ti)<<
II(a,b,c,d,Mj,s,ti)表示a=b+((a+I(b,c,d)+Mj+ti)<<
四輪運(yùn)算
第一輪
a=FF(a,b,c,d,M0,7,0xd76aa478)
b=FF(d,a,b,c,M1,12,0xe8c7b756)
c=FF(c,d,a,b,M2,17,0x242070db)
d=FF(b,c,d,a,M3,22,0xc1bdceee)
a=FF(a,b,c,d,M4,7,0xf57c0faf)
b=FF(d,a,b,c,M5,12,0x4787c62a)
c=FF(c,d,a,b,M6,17,0xa8304613)
d=FF(b,c,d,a,M7,22,0xfd469501)
a=FF(a,b,c,d,M8,7,0x698098d8)
b=FF(d,a,b,c,M9,12,0x8b44f7af)
c=FF(c,d,a,b,M10,17,0xffff5bb1)
d=FF(b,c,d,a,M11,22,0x895cd7be)
a=FF(a,b,c,d,M12,7,0x6b901122)
b=FF(d,a,b,c,M13,12,0xfd987193)
c=FF(c,d,a,b,M14,17,0xa679438e)
d=FF(b,c,d,a,M15,22,0x49b40821)
第二輪
a=GG(a,b,c,d,M1,5,0xf61e2562)
b=GG(d,a,b,c,M6,9,0xc040b340)
c=GG(c,d,a,b,M11,14,0x265e5a51)
d=GG(b,c,d,a,M0,20,0xe9b6c7aa)
a=GG(a,b,c,d,M5,5,0xd62f105d)
b=GG(d,a,b,c,M10,9,0x02441453)
c=GG(c,d,a,b,M15,14,0xd8a1e681)
d=GG(b,c,d,a,M4,20,0xe7d3fbc8)
a=GG(a,b,c,d,M9,5,0x21e1cde6)
b=GG(d,a,b,c,M14,9,0xc33707d6)
c=GG(c,d,a,b,M3,14,0xf4d50d87)
d=GG(b,c,d,a,M8,20,0x455a14ed)
a=GG(a,b,c,d,M13,5,0xa9e3e905)
b=GG(d,a,b,c,M2,9,0xfcefa3f8)
c=GG(c,d,a,b,M7,14,0x676f02d9)
d=GG(b,c,d,a,M12,20,0x8d2a4c8a)
第三輪
a=HH(a,b,c,d,M5,4,0xfffa3942)
b=HH(d,a,b,c,M8,11,0x8771f681)
c=HH(c,d,a,b,M11,16,0x6d9d6122)
d=HH(b,c,d,a,M14,23,0xfde5380c)
a=HH(a,b,c,d,M1,4,0xa4beea44)
b=HH(d,a,b,c,M4,11,0x4bdecfa9)
c=HH(c,d,a,b,M7,16,0xf6bb4b60)
d=HH(b,c,d,a,M10,23,0xbebfbc70)
a=HH(a,b,c,d,M13,4,0x289b7ec6)
b=HH(d,a,b,c,M0,11,0xeaa127fa)
c=HH(c,d,a,b,M3,16,0xd4ef3085)
d=HH(b,c,d,a,M6,23,0x04881d05)
a=HH(a,b,c,d,M9,4,0xd9d4d039)
b=HH(d,a,b,c,M12,11,0xe6db99e5)
c=HH(c,d,a,b,M15,16,0x1fa27cf8)
d=HH(b,c,d,a,M2,23,0xc4ac5665)
第四輪
a=II(a,b,c,d,M0,6,0xf4292244)
b=II(d,a,b,c,M7,10,0x432aff97)
c=II(c,d,a,b,M14,15,0xab9423a7)
d=II(b,c,d,a,M5,21,0xfc93a039)
a=II(a,b,c,d,M12,6,0x655b59c3)
b=II(d,a,b,c,M3,10,0x8f0ccc92)
c=II(c,d,a,b,M10,15,0xffeff47d)
d=II(b,c,d,a,M1,21,0x85845dd1)
a=II(a,b,c,d,M8,6,0x6fa87e4f)
b=II(d,a,b,c,M15,10,0xfe2ce6e0)
c=II(c,d,a,b,M6,15,0xa3014314)
d=II(b,c,d,a,M13,21,0x4e0811a1)
a=II(a,b,c,d,M4,6,0xf7537e82)
b=II(d,a,b,c,M11,10,0xbd3af235)
c=II(c,d,a,b,M2,15,0x2ad7d2bb)
d=II(b,c,d,a,M9,21,0xeb86d391)
每輪循環(huán)后,將A、B、C、D分別加上a,b,c,d,然后進(jìn)入下一循環(huán)
六 AT指令組件相關(guān)軟件的使用
1 Gitee鏈接地址
組件位于amaziot_bloom_os_sdklibrariesamxtuam_at.c
Gitee源碼地址:https://gitee.com/ning./hongdou
Github源碼地址:https://github.com/ayumid/hongdou
2 應(yīng)用層組件功能介紹
提供MD5的計(jì)算方法。
3 代碼講解
1 mbedtls_md5
計(jì)算MD5,并將結(jié)果傳入形參中
ret = mbedtls_md5( sample_md5_test_buf[i], sample_md5_test_buflen[i], md5sum );
2 mbedtls_md5_finish
最終計(jì)算MD5。
ret = mbedtls_md5_finish( &ctx, output )
3 mbedtls_md5_update
更新MD5buf數(shù)據(jù)
ret = mbedtls_md5_update( &ctx, input, ilen )
4 mbedtls_md5_starts
設(shè)置MD5計(jì)算context
ret = mbedtls_md5_starts( &ctx )
4 Demo實(shí)戰(zhàn)
4.1 創(chuàng)建一個(gè)Demo
復(fù)制8.6_random示例工程,到同一個(gè)文件夾下,修改文件名為9.1_md5,如圖:
4.2 修改makefile
4.3 增加頭文件
使用代碼編輯器,將新建的工程文件加入代碼編輯器中,打開main.c,修改main.c,加入頭文件,如圖:
4.4 修改代碼
在Phase2Inits_exit 調(diào)用文件組件提供的對(duì)外API,如圖:
4.5 編譯
在SDK根目錄打開命令行,輸入命令.build.bat -l .amaziot_bloom_os_sdksamplelibraries9.1_md5
λ .build.bat -l .amaziot_bloom_os_sdksamplelibraries9.1_md5 子目錄或文件 outbin 已經(jīng)存在。 子目錄或文件 buildmbedTLS 已經(jīng)存在。 子目錄或文件 buildobj 已經(jīng)存在。 gnumake: Entering directory `F:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/9.1_md5' armcc.exe -c --cpu Cortex-R4 --no_unaligned_access -g -O2 --apcs /inter --diag_suppress 2084,1,2,177,188,223,550,1296,2795,6319,9931,9933 --diag_error=warning --gnu --thumb --loose_implicit_cast -DDATA_COLLECTOR_IMPL -DISPT_OVER_SSP -DDIAG_SSP_DOUBLE_BUFFER_USE_DYNAMIC_ALLOCATION -DENV_XSCALE -DL1_DCXO_ENABLED -DLTE_HIGH_MOBILITY_OPTIMIZATION -DRUN_XIP_MODE -DCRANE_Z2 -DCA_LONG_IPC_MSG -DNEZHA3 -DNEZHA3_1826 -DUPGRADE_PLMS -DUPGRADE_PLMS_SR -DLTE_GSMMULTIBCCH -DGPLC_LTE_RSSI_SCAN -DL1V_NEW_RSSI -DUPGRADE_PLMS_3G -DUPGRADE_PLMS_L1 -DUPGRADE_FG_PLMS -DFG_PLMS_URR -DUPGRADE_L1A_FG_PLMS -DUPGRADE_PLMS_STAGE_2 -DUPGRADE_MBCCH -DMULTI_BCCH_READY_IND -DURR_MRAT_ICS_SEARCH -DUPGRADE_ICS -DMRAT_NAS -DUPGRADE_PLMS_SEARCH_API -DICS_MBCCH -DICS_MBCCH_2G_RSSI -DDIAG_NEWPP -DPHS_SW_DEMO -DPHS_SW_DEMO_TTC -DPHS_SW_DEMO_TTC_PM -DFULL_SYSTEM -D_DDR_INIT_ -D_TAVOR_HARBELL_ -DUPGRADE_ARBEL_PLATFORM -D_TAVOR_B0_SILICON_ -DTDL1C_SPY_ENABLE -DDLM_TAVOR -DTAVOR -DFLAVOR_DUALCORE -DDEBUG_D2_MOR_REG_RESEREVED_ENABLE -D_DIAG_USE_COMMSTACK_ -D_TAVOR_DIAG_ -DPM_DEBUG_MODE_ENABLED -DPM_D2FULL_MODE -DPM_EXT_DBG_INT_ARR -DFEATURE_WB_AMR_PS -DMACRO_FOR_LWG -DHL_LWG -DOPTIMIZE_FOR_2G_BCCH -DPLAT_TEST -D_FDI_USE_OSA_ -DPLAT_USE_THREADX -DLWIP_IPNETBUF_SUPPORT -DCRANE_MCU_DONGLE -DAT_OVER_UART -DPHS_SW_DEMO_TTC_PM -DUPGRADE_LTE_ONLY -DEXT_AT_MODEM_SUPPORT -DLTEONLY_THIN_SINGLE_SIM -DLFS_FILE_SYS -DLFS_FILE_SYS_V2 -DPSM_ENABLE -DNO_PAHO_MQTT -DNO_XML -DNO_LWM2M -DREMOVE_MBEDTLS -DNO_AT_NET -DCRANE_SD_NOT_SUPPORT -DNTP -DYMODEM_EEH_DUMP -DENABLE_DM_LTEONLY -DLTEONLY_THIN -DNO_EXTEND_MY_Q_AT -DNOT_SUPPORT_HTTPS -DNOT_SUPPORT_PM813 -DCRANEL_4MRAM -DREMOVE_PB -DUART_NEW_VERSION -DREMOVE_MEP -DREMOVE_SMS -DREMOVE_ENVSIM -DAPN_INCODE -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -DASR160X_OPENCPU_FEATURE -DENABLE_UART3_FEATRUE -DENABLE_UART4_FEATRUE -DYUGE_MBEDTLS_3_2_1 -DENABLE_MAC_TX_DATA_LOGGING -DDISABLE_NVRAM_ACCESS -DINTEL_UPGRADE_EE_HANDLER_SUPPORT -DLTE_W_PS -DL1_DUAL_MODE -DUPGRADE_HERMON_DUAL -DINTEL_UPGRADE_DUAL_RAT -DINTEL_UPGRADE_GPRS_CIPHER_FLUSH -DUPGRADE_ENHANCED_QUAD_BAND -DINTEL_2CHIP_PLAT -DI_2CHIP_PLAT -DUPGRDE_TAVOR_COMMUNICATION -DRUN_WIRELESS_MODEM -DFLAVOR_DDR12MB_GB1MB5 -DFEATURE_SHMEM -DACIPC_ENABLE_NEW_CALLBACK_MECHANISM -DRELIABLE_DATA -DMAP_NSS -DTV_FNAME=""SW_PLATFORM=PMD2NONE PHS_SW_DEMO PHS_SW_DEMO_PM SRCNUCLEUS FULL_SYSTEM NOACRTC PDFLT PLAT_TEST PV2 DIAGOSHMEM NVM WITHL1V"" -DTV_FDESC=""SW_DESCRIPTION="" -DENABLE_ACIPC -D_DATAOMSL_ENABLED_ -DUSB_CABLE_DETECTION_VIA_PMIC -DMIPS_TEST -DMIPS_TEST_RAM -DFLAVOR_DIET_RAM -DNVM_INCLUDE -DMSL_INCLUDE -DMSL_POOL_MEM -DNO_AUDIO -DOSA_QUEUE_NAMES -D_DIAG_DISABLE_USB_ -DOSA_NUCLEUS -DOSA_USED -DPM_D2NONE_MODE -DCRANE_SOC_TEMPERATURE_SENSOR -DL1_SW_UPDATE_FOR_DIGRF -DPHS_L1_SW_UPDATE_R7 -DUPGRADE_LTE -DFRBD_CALIB_NVM -DFRBD_AGC_CALIB -DFRBD_FDT_CALIB -DHSPA_MPR -DCAPT_PARAMS_OPTIMIZE -DL1_WB_R99_ONLY -DL1V_WB_R99_ONLY -DINTERGRATED_RF_SUPPORT -DL1_RX_DIV_SUPPORT -DENABLE_OOS_HANDLING -DTAVOR_D2_WB_L1_SUPPORT -DL1_DDR_HIGH_FREQ -DUPGRADE_DIGRF3G_SUPPORT -DW_PS_PLUS_G_PAGING -D"NO_APLP=0" -DINTEL_UPGRADE_UNIFIED_VOICE_TASK -DINTEL_UPGRADE_R99 -DAPLP_SPY_ENABLE -D__TARGET_FEATURE_DOUBLEWORD -DWHOLE_UMTS_STACK -DUSE_TTPCOM_CSR_BLUETOOTH_AUDIO_GAIN_CONTROL -DL1_UPGRADE_R5 -DUPGRADE_EDGE -DUPGRADE_R4_FS1 -DINTEL_UPGRADE_GSM_CRL_IF -DUPGRADE_EGPRS_M -DINTEL_UPGRADE_EGPRS_M -DINTEL_UPGRADE_RF_PARAMS_IN_CF_TDS -DINTEL_UPGRADE_2SAMPLES_PER_SYMBOL -D"GPRS_MULTISLOT_CLASS=12" -D"EGPRS_MULTISLOT_CLASS=12" -DMARVELL_UPGRADE_BSIC_REDESIGN -DMSL_INCLUDE -DINTEL_HERMON_SAC -DCRANE_CUST_BUILD -DL1_SW_UPDATE_FOR_DIGRF -DFLAVOR_COM -DSILICON_PV2 -DSILICON_SEAGULL -DSILICON_TTC_CORE_SEAGULL -DPCAC_INCLUDE -Otime -DBUILD_DATE=""09 04 2024"" -DBUILD_TIME=""15:07:27"" -Iatcmdsinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptelephonyyugeinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalUARTinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalcoreinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalPMUinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalGPIOinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xosposixinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xdiagdiag_logicsrc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xcswSysCfginc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xcswplatforminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xenvwin32inc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xcswBSPinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xcswplatformdev_platbuild -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xososainc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xosthreadxinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xosnu_xscaleinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacpsminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcachttpclientsrc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xdiagdiag_logicinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptimerinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopintcinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xcswPMinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoppminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilTickManagerinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopBSPinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptelephonyatcmdsrvinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptelephonyatparserinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptelephonysdkinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcachttpclientinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacciinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcaclwipv4v6srcinclude -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcaclwipv4v6srcincludearch -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcaclwipv4v6srcincludeipv4 -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcaclwipv4v6srcincludeipv6 -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcaclwipv4v6srcincludelwip -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcaclwipv4v6srcincludenetif -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopmmi_matinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xtavorArbelinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xtavorenvinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptelephonymodeminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacdusterinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacfotainc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalI2Cinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalACIPCinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilfatsysflash -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilFDIsrcINCLUDE -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalMMUinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilFDIsrcFDI_ADD -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilFDIsrcFM_INC -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilfatsysfshdr -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutillittlefsinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacttsinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacdialinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilcsw_memoryinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoputilitiesinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopcommpminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilnvminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilEEhandlerinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilEEhandlersrc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopRTCinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhoptelephonyci_clientinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalBT_deviceinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalUARTinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopmrdinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopdmainc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilsoftutilinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhalSPIinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacwebsocketinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacatnet_srvinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xsoftutilfotacomminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xaud_swAudioinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xaud_swACM_COMMinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xaud_swaudio_stubsrc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhopaaminc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xaud_swAudioHALinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xhaldbgshellinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFincludeasr160xpcacopencpuinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFamaziot_bloom_os_sdkutils -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1asros -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1 -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1inc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1include -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1includembedtls -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1incmbedtls -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFCSDK_CODEmbedTLSmbedTLS_3_2_1testsincludetest -DSDK_ENABLE_MBEDTLS -IF:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/9.1_md5aminc -IF:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/9.1_md5atcmdsinc -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFamaziot_bloom_os_sdkutils -IF:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFamaziot_bloom_os_sdklibraries -o buildobj/ext_at_cmds.o F:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/9.1_md5/atcmds/src/ext_at_cmds.c armlink.exe buildobj/main.o buildobj/ext_at_cmds.o buildobj/ext_at_controller.o buildCSDK_CODE.lib -o F:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFoutbinArbel_PMD2NONE_40M.axf --via F:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFprebuilt_1606lArbel_PMD2NONE_targ_objliblist.txt --elf --scatter F:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFprebuilt_1606lCrane_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct --predefine="-DLTEONLY_THIN_SINGLE_SIM" --map --symbols --info sizes,totals --list F:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFoutbinArbel_PMD2NONE_40M.map --keep init.o(Header) --keep init.o(Vectors) --diag_suppress 6312,6314,6319,6329 --feedback F:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFoutfeedbackLinkOptLteonlyThin_SingleSim_NoSMS.txt F:3.asr-bcat.1-asr16061.softwareBLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRFtoolsbuildimage_1606l.bat SDK_PROD_TYPE : [DM] SDK_CUST_SKU : [THIN_SINGLE_SIM_NO_SMS] SDK_PS_MODE : [LTEONLY] SDK_CHIP_VER : [Z2A0] SDK_OS_TYPE : [TX] Platform Convertion Tools v4.01 with PS option extension Convertion done! |INPUT |outbincp_1606L.bin |MARK |NAME |EXEADDR .LOADADDR.LENGTH .CPZLADDR|COMPRESS STASTIC | |--------|--------|--------.--------.--------.--------|------------------------------| |This Is LteOnly 4M| |RW_CPZ_1|DDR_RW_ |7e119000.800650b0.0000cdd4.80066000|0000cdd4->00003000 |This Is LteOnly 4M| |RW_CPZ_2|PS_NCAH |7e388000.80071e84.00001300.80069000|00001300->00001000 |This Is LteOnly 4M| |RW_CPZ_3|ITCM |7e3dac00.80073184.0000f51c.8006a000|0000f51c->0000a000 |This Is LteOnly 4M| |RW_CPZ_4|CODE_PS |7e1aa000.800826a0.0002fe38.80074000|0002fe38->0001e000 |This Is LteOnly 4M| |RW_CPZ_5|CODEPSB |7e1dc000.800b24d8.000339c0.80092000|000339c0->0001b000 |This Is LteOnly 4M| |RW_CPZ_6|CODEPSC |7e213000.800e5e98.000323ec.800ad000|000323ec->0001b000 |This Is LteOnly 4M| |RW_CPZ_7|CODEPSD |7e249000.80118284.00028d88.800c8000|00028d88->0001a000 |This Is LteOnly 4M| |RW_CPZ_8|CODEPSE |7e277000.8014100c.0002e310.800e2000|0002e310->0001a000 |This Is LteOnly 4M| |RW_CPZ_9|CODEPSF |7e2a9000.8016f31c.0001c948.800fc000|0001c948->00011000 |This Is LteOnly 4M| |RW_CPZ_A|CODE_PL |7e2ca000.8018bc64.0002fa44.8010d000|0002fa44->0001e000 |This Is LteOnly 4M| |RW_CPZ_B|CODEPLB |7e2fa000.801bb6a8.00039058.8012b000|00039058->00022000 |This Is LteOnly 4M| |RW_CPZ_C|CODEPLC |7e337000.801f4700.000268d4.8014d000|000268d4->00011000 |--------|--------|--------.--------.--------.--------|------------------------------| | | 0x00203fd4 -> 0x00147000| | | 2.016(MB) -> 1.277(MB)| |------------------------------------------------------------------------------------| cp_1606L.axf cp_1606L.bin cp_1606L.map gnumake: Leaving directory `F:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/9.1_md5' "copy NEZHAC_CP_CNR_MIFI_TX.bin to ./ " 已復(fù)制 1 個(gè)文件。
4.6 生成固件
參考入門中開發(fā)工具,生成工具。
4.7 查看現(xiàn)象
固件下載到模組后,發(fā)送AT指令。AT串口信息如下:
點(diǎn)擊下載 MD5 Demo 固件(見Wiki:Cellular IoT Wiki 知識(shí)庫)
5 總結(jié)
根據(jù)實(shí)驗(yàn)現(xiàn)象,可以實(shí)現(xiàn)MD5哈希值的計(jì)算,
本文章源自奇跡物聯(lián)開源的物聯(lián)網(wǎng)應(yīng)用知識(shí)庫Cellular IoT Wiki,更多技術(shù)干貨歡迎關(guān)注收藏Wiki:Cellular IoT Wiki 知識(shí)庫(https://rckrv97mzx.feishu.cn/wiki/wikcnBvAC9WOkEYG5CLqGwm6PHf)
歡迎同學(xué)們走進(jìn)AmazIOT知識(shí)庫的世界!
這里是為物聯(lián)網(wǎng)人構(gòu)建的技術(shù)應(yīng)用百科,以便幫助你更快更簡單的開發(fā)物聯(lián)網(wǎng)產(chǎn)品。
Cellular IoT Wiki初心:
在我們長期投身于蜂窩物聯(lián)網(wǎng) ODM/OEM 解決方案的實(shí)踐過程中,一直被物聯(lián)網(wǎng)技術(shù)碎片化與產(chǎn)業(yè)資源碎片化的問題所困擾。從產(chǎn)品定義、芯片選型,到軟硬件研發(fā)和測試,物聯(lián)網(wǎng)技術(shù)的碎片化以及產(chǎn)業(yè)資源的碎片化,始終對(duì)團(tuán)隊(duì)的產(chǎn)品開發(fā)交付質(zhì)量和效率形成制約。為了減少因物聯(lián)網(wǎng)碎片化而帶來的重復(fù)開發(fā)工作,我們著手對(duì)物聯(lián)網(wǎng)開發(fā)中高頻應(yīng)用的技術(shù)知識(shí)進(jìn)行沉淀管理,并基于 Bloom OS 搭建了不同平臺(tái)的 RTOS 應(yīng)用生態(tài)。后來我們發(fā)現(xiàn),很多物聯(lián)網(wǎng)產(chǎn)品開發(fā)團(tuán)隊(duì)都面臨著相似的困擾,于是,我們決定向全體物聯(lián)網(wǎng)行業(yè)開發(fā)者開放奇跡物聯(lián)內(nèi)部沉淀的應(yīng)用技術(shù)知識(shí)庫 Wiki,期望能為更多物聯(lián)網(wǎng)產(chǎn)品開發(fā)者減輕一些重復(fù)造輪子的負(fù)擔(dān)。
Cellular IoT Wiki沉淀的技術(shù)內(nèi)容方向如下:
奇跡物聯(lián)的業(yè)務(wù)服務(wù)范圍:基于自研的NB-IoT、Cat1、Cat4等物聯(lián)網(wǎng)模組,為客戶物聯(lián)網(wǎng)ODM/OEM解決方案服務(wù)。我們的研發(fā)技術(shù)中心在石家莊,PCBA生產(chǎn)基地分布在深圳、石家莊、北京三個(gè)工廠,滿足不同區(qū)域&不同量產(chǎn)規(guī)模&不同產(chǎn)品開發(fā)階段的生產(chǎn)制造任務(wù)。跟傳統(tǒng)PCBA工廠最大的區(qū)別是我們只服務(wù)物聯(lián)網(wǎng)行業(yè)客戶。
連接我們,和10000+物聯(lián)網(wǎng)開發(fā)者一起 降低技術(shù)和成本門檻
讓蜂窩物聯(lián)網(wǎng)應(yīng)用更簡單~~
哈哈你終于滑到最重要的模塊了,
千萬不!要!劃!走!忍住沖動(dòng)!~
歡迎加入飛書“開源技術(shù)交流群”,隨時(shí)找到我們哦~
點(diǎn)擊鏈接如何加入奇跡物聯(lián)技術(shù)話題群(https://rckrv97mzx.feishu.cn/docx/Xskpd1cFQo7hu9x5EuicbsjTnTf)可以獲取加入技術(shù)話題群攻略
Hey 物聯(lián)網(wǎng)從業(yè)者,
你是否有了解過奇跡物聯(lián)的官方公眾號(hào)“eSIM物聯(lián)工場”呢?
這里是奇跡物聯(lián)的物聯(lián)網(wǎng)應(yīng)用技術(shù)開源wiki主陣地,歡迎關(guān)注公眾號(hào),不迷路~
及時(shí)獲得最新物聯(lián)網(wǎng)應(yīng)用技術(shù)沉淀發(fā)布
注:本文部分內(nèi)容來源于網(wǎng)絡(luò),如有侵權(quán),請(qǐng)及時(shí)聯(lián)系我們。
-
物聯(lián)網(wǎng)
+關(guān)注
關(guān)注
2902文章
44114瀏覽量
370409 -
算法
+關(guān)注
關(guān)注
23文章
4592瀏覽量
92519 -
函數(shù)
+關(guān)注
關(guān)注
3文章
4286瀏覽量
62335
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論