Documentation
¶
Index ¶
- func Base64Decode(str string) string
- func Base64Encode(str string) string
- func Decrypt(encryptedMessage string, sk string) string
- func DecryptByte(encryptedMessage []byte, sk []byte) string
- func Encrypt(message string, ak string) string
- func EncryptByte(message []byte, ak []byte) []byte
- func GenerateKeyPair() (public_key, private_key string)
- func GenerateKeyPairByte() ([]byte, []byte)
- func GetPrivateKey() []byte
- func New(key []byte) (cipher.Block, error)
- func PrivateDecryptByte(key []byte, ciphertext []byte) ([]byte, error)
- func PrivateEncryByte(key []byte, plaintext []byte) ([]byte, error)
- type Key
- type KeyPair
- type KeySizeError
- type PrivateKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
Base64Decode decodes a base64 encoded string
func Base64Encode ¶
func DecryptByte ¶
func EncryptByte ¶
func GenerateKeyPair ¶
func GenerateKeyPair() (public_key, private_key string)
func GenerateKeyPairByte ¶
Types ¶
type KeyPair ¶
func NewKeyPair ¶
func NewKeyPair() *KeyPair
func (*KeyPair) DecryptString ¶
func (*KeyPair) EncryptByte ¶
func (*KeyPair) EncryptString ¶
type KeySizeError ¶
type KeySizeError int
func (KeySizeError) Error ¶
func (k KeySizeError) Error() string
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func NewPrivateKey ¶
func NewPrivateKey() *PrivateKey
func (*PrivateKey) DecryptByte ¶
func (p *PrivateKey) DecryptByte(ciphertext []byte) ([]byte, error)
func (*PrivateKey) DecryptString ¶
func (p *PrivateKey) DecryptString(ciphertext string) (string, error)
func (*PrivateKey) EncryptByte ¶
func (p *PrivateKey) EncryptByte(plaintext []byte) ([]byte, error)
func (*PrivateKey) EncryptString ¶
func (p *PrivateKey) EncryptString(plaintext string) (string, error)
Click to show internal directories.
Click to hide internal directories.