綠界科技檢查碼與 AES 加解密範例檔

Roan
Apr 30, 2024

--

在串接綠界金流、物流、電子發票時,有些發送的參數(payload)中會需要檢查碼(CheckMacValue),有些則需要將 JSON 格式的資料進行 AES 加密後再送出。這些都是出於資安考量。

A cyber security expert is intensely analyzing data across multiple screens in a high-tech environment. The background features dynamic displays of code and data streams, visually representing a network security operations center. The atmosphere is filled with a futuristic blue and green light emanating from the screens, highlighting the expert’s concentration and the seriousness of their work. The setting conveys a state-of-the-art workplace dedicated to safeguarding digital information. Movie screenshot. — ar 3:2 — v 6.0

我曾寫過綠界科技檢查碼(CheckMacValue)產生器,以及綠界科技電子發票資料驗證器。這兩則程式碼分別有計算檢查碼與 AES 加解密的功能。這次我合併兩個功能,成為一個獨立的範例檔,以供方便取用,不需要另外再執行另一個專案檔。

一切都是為了資安

不管是檢查碼還是 AES 加密,都是為了資安。一開始的時候可能會搞不太清楚檢查碼(可再參考 用 Node.js 輕鬆實現雜湊演算法 — — Hash 與 Hmac )與 AES 加密,但多幾次實作並逐漸上手後,就能體會在資安上的重要性了。

artistic photo of an engineer using a laptop while strings of programming codes and money flying around — ar 3:2 — s 50 — v 6.0

--

--

Roan

Javascript/HTML/CSS/React/Node.JS 我是光頭工程師