密碼算法相關(guān)
本文為您介紹密碼算法相關(guān)函數(shù)的語法、說明、參數(shù)、返回值和示例。
aes_new
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 創(chuàng)建AES對(duì)象,用于后續(xù)的 |
參數(shù) |
|
返回值 | 成功返回AES對(duì)象(字典類型),失敗返回 |
示例 |
|
aes_enc
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | AES加密。 |
參數(shù) |
|
返回值 | 返回對(duì) |
示例 |
|
aes_dec
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | AES解密。 |
參數(shù) |
|
返回值 | 返回對(duì) |
示例 |
|
sha1
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 計(jì)算SHA1摘要。 |
參數(shù) | s:待計(jì)算摘要的字符串。 |
返回值 | 返回SHA1摘要的二進(jìn)制形式。 |
示例 |
|
sha2
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 計(jì)算SHA2摘要。 |
參數(shù) |
|
返回值 | 使用SHA2摘要的二進(jìn)制形式。 |
示例 |
|
hmac
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 計(jì)算HMAC類算法摘要。 |
參數(shù) |
|
返回值 | 使用對(duì)應(yīng)算法HMAC摘要的二進(jìn)制形式。 |
示例 |
|
hmac_sha1
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 計(jì)算HMAC-SHA-1摘要。 |
參數(shù) |
|
返回值 | 返回HMAC-SHA-1摘要的二進(jìn)制形式。 |
示例 |
|
md5
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 計(jì)算MD5摘要。 |
參數(shù) | s:待計(jì)算摘要的字符串。 |
返回值 | 返回MD5摘要的十六進(jìn)制形式。 |
示例 |
|
md5_bin
函數(shù)詳細(xì)信息,請(qǐng)參見下表:
項(xiàng)目 | 描述 |
語法 |
|
說明 | 計(jì)算MD5摘要。 |
參數(shù) | s:待計(jì)算摘要的字符串。 |
返回值 | 返回MD5摘要的二進(jìn)制形式。 |
示例 |
|