// The AES block size in bytes.
const BlockSize = 16
// NewCipher creates and returns a new cipher.Block. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func NewCipher(key []byte) (cipher.Block, error)
type Block interface {
// BlockSize returns the cipher's block size.
BlockSize() int
// Encrypt encrypts the first block in src into dst.
// Dst and src may point at the same memory.
Encrypt(dst, src []byte)
// Decrypt decrypts the first block in src into dst.
// Dst and src may point at the same memory.
Decrypt(dst, src []byte)
}
type BlockMode interface {
// BlockSize returns the mode's block size.
BlockSize() int
// CryptBlocks encrypts or decrypts a number of blocks. The length of
// src must be a multiple of the block size. Dst and src may point to
// the same memory.
CryptBlocks(dst, src []byte)
}
func NewCBCDecrypter(b Block, iv []byte) BlockMode
func NewCBCEncrypter(b Block, iv []byte) BlockMode
官方例子
https://go-zh.org/pkg/crypto/cipher/#example_NewCBCDecrypter
package main
import

本文介绍了如何使用Go语言的crypto/cipher库来实现m3u8中ts文件的AES CBC模式的加解密操作。通过官方示例和参考链接中的方法,可以对批量ts文件进行解密处理。
最低0.47元/天 解锁文章
3236

被折叠的 条评论
为什么被折叠?



