mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
加密算法
This commit is contained in:
18
crypto/crypto.go
Normal file
18
crypto/crypto.go
Normal file
@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user