mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-17 16:12:42 +08:00
19 lines
367 B
Go
19 lines
367 B
Go
package crypto
|
|
|
|
// 对称加密
|
|
type ISymmetric interface {
|
|
Encrypt(msg []byte) ([]byte, error)
|
|
Decrypt(cipherText []byte) ([]byte, error)
|
|
}
|
|
|
|
// 非对称加密
|
|
type IAsymmetric interface {
|
|
Encrypt(msg []byte) ([]byte, error)
|
|
Decrypt(ciphertext []byte) ([]byte, error)
|
|
}
|
|
|
|
type Signer interface {
|
|
Sign(msg []byte) ([]byte, error)
|
|
Verify(msg, sign []byte) bool
|
|
}
|