gemina

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

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

View Source
const (
	PackageVersion = "0.1.0"
)

Variables

View Source
var (
	UnknownVersionError = errors.New("gemina: unknown version")
	DecryptionError     = errors.New("gemina: cannot decrypt data")
)

Functions

func CreateSecretKey

func CreateSecretKey(version Version) ([]byte, error)

CreateSecretKey creates a secret key that can be used with the functions EncryptWithKey(), DecryptWithKey(), and VerifyWithKey().

func DecryptWithKey

func DecryptWithKey(key, data []byte) ([]byte, error)

DecryptWithKey decrypts data with the given secret key.

func DecryptWithPassword

func DecryptWithPassword(password, data []byte) ([]byte, error)

DecryptWithPassword decrypts data with the given password.

func EncryptWithKey

func EncryptWithKey(key, data []byte, version Version) ([]byte, error)

EncryptWithKey encrypts data with the given secret key and version.

func EncryptWithPassword

func EncryptWithPassword(password, data []byte, version Version) ([]byte, error)

EncryptWithPassword encrypts data with the given password and version.

func VerifyWithKey

func VerifyWithKey(key, data []byte) bool

VerifyWithKey verifies data with the given secret key.

func VerifyWithPassword

func VerifyWithPassword(password, data []byte) bool

VerifyWithPasswordverifies verifies data with the given password.

Types

type Version

type Version byte
const (
	Version1 Version = 0x8a
	Version2 Version = 0x8b
	Version3 Version = 0x8c
	Version4 Version = 0x8d
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL