Documentation ¶
Overview ¶
Package ccrypt 实现net.conn的加密conn接口 aes cfb加密码的连接,通过提供的配置使用pbkdf2生成key, 依靠key和hash生成iv
Index ¶
Constants ¶
View Source
const ( DefaultIterations = 2048 DefaultKeySize = 32 // 32byte 256bits )
Config defaults
Variables ¶
View Source
var ( DefaultHash = sha256.New DefaultSalt = []byte(`dfaod..ga'.';dfa,;dfa',';023pkadb;j90[[q93jr4poemf';adm;lcv;aodfm'a;dlm[f09eqegoain;lfgankd;gihqp8e8hladknaldkpq3h4''`) // nolint: lll )
Config defaults
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Password string // 用户加密密钥 Salt []byte // default: DefaultSalt Iterations int // 迭代次数,次数越多加密与解密所需时间越长, default: 2048 KeySize int // 期望密文长度,支持16,24,32, default: 32 Hash func() hash.Hash // 加密所使用的hash函数, default: DefaultHash(sha256.New) }
Config PBKDF2 key 生成的参数配置
Click to show internal directories.
Click to hide internal directories.