Documentation ¶
Index ¶
- Constants
- func B64Decode(msg string) ([]byte, error)
- func B64Encode(msg []byte) string
- func Decrypt(ciphertextAndNonce, key []byte) ([]byte, error)
- func Encrypt(plaintext, key []byte) ([]byte, error)
- func GenerateKey(passwordLength, minSpecialChar, minNum, minUpperCase int) string
- func GetMD5Hash(data []byte) string
- func RandString(n int) string
- func RandomRange(lower, upper int) int
- func Sha1(plain string) string
- func Sha256(data []byte) string
- func XOR(input, key string) (output string)
- type RSA
- func (r *RSA) Decrypt(ciphertext []byte) (plaintext []byte, err error)
- func (r *RSA) Encrypt(msg []byte) (ciphertext []byte, err error)
- func (r *RSA) GenerateKeyPair(key io.Reader, bits int) (err error)
- func (r *RSA) PrivateKeyToBytes() []byte
- func (r *RSA) PublicKeyToBytes() (pubBytes []byte, err error)
Constants ¶
View Source
const AlgorithmNonceSize int = 12
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GetMD5Hash ¶
func RandString ¶
func RandomRange ¶
Types ¶
type RSA ¶
type RSA struct {
// contains filtered or unexported fields
}
func BytesToPrivateKey ¶
func BytesToPublicKey ¶
func (*RSA) GenerateKeyPair ¶
GenerateKeyPair generates a new key pair
func (*RSA) PrivateKeyToBytes ¶
func (*RSA) PublicKeyToBytes ¶
Click to show internal directories.
Click to hide internal directories.