📌  相关文章
📜  golang ecb aes - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:01.693000             🧑  作者: Mango

代码示例1
package main

import (
    "crypto/aes"
)

func DecryptAes128Ecb(data, key []byte) []byte {
    cipher, _ := aes.NewCipher([]byte(key))
    decrypted := make([]byte, len(data))
    size := 16

    for bs, be := 0, size; bs < len(data); bs, be = bs+size, be+size {
        cipher.Decrypt(decrypted[bs:be], data[bs:be])
    }

    return decrypted
}