Documentation ¶
Overview ¶
Package gemina provides an implementation of the Gemina specification for data encryption.
See section "Description" in the specification: https://github.com/andreas19/gemina-spec#description
Index ¶
- Constants
- Variables
- func CreateSecretKey(version Version) ([]byte, error)
- func DecryptWithKey(key, data []byte) ([]byte, error)
- func DecryptWithPassword(password, data []byte) ([]byte, error)
- func EncryptWithKey(key, data []byte, version Version) ([]byte, error)
- func EncryptWithPassword(password, data []byte, version Version) ([]byte, error)
- func VerifyWithKey(key, data []byte) bool
- func VerifyWithPassword(password, data []byte) bool
- type Version
Constants ¶
const (
PackageVersion = "0.2.0"
)
Variables ¶
var ( ErrUnknownVersion = errors.New("gemina: unknown version") ErrDecryption = errors.New("gemina: cannot decrypt data") )
Functions ¶
func CreateSecretKey ¶
CreateSecretKey creates a secret key that can be used with the functions EncryptWithKey(), DecryptWithKey(), and VerifyWithKey().
func DecryptWithKey ¶
DecryptWithKey decrypts data with the given secret key.
func DecryptWithPassword ¶
DecryptWithPassword decrypts data with the given password.
func EncryptWithKey ¶
EncryptWithKey encrypts data with the given secret key and version.
func EncryptWithPassword ¶
EncryptWithPassword encrypts data with the given password and version.
func VerifyWithKey ¶
VerifyWithKey verifies data with the given secret key.
func VerifyWithPassword ¶
VerifyWithPasswordverifies verifies data with the given password.