encryptservice

package
v0.0.0-...-b8ee67f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CHUNK_SIZE = 8192 * 2
View Source
const ECDH_PUBKEY_SIZE = 65

65 for P-256, 32 for X25519

View Source
const PBKDF_ITERATIONS = 100000
View Source
const SALT_SIZE = 32

Variables

This section is empty.

Functions

func GenerateEcdhKeypair

func GenerateEcdhKeypair() (*ecdh.PrivateKey, error)

func GenreateSalt

func GenreateSalt() ([]byte, error)

func ParsePublicKey

func ParsePublicKey(pubKey []byte) (*ecdh.PublicKey, error)

func ShareCodeHash

func ShareCodeHash(shareCode string) string

Types

type GcmService

type GcmService struct {
	// contains filtered or unexported fields
}

func NewGcmService

func NewGcmService(priKey *ecdh.PrivateKey, pubKey *ecdh.PublicKey, discoverPhrase string) (*GcmService, error)

func (*GcmService) Decrypt

func (g *GcmService) Decrypt(r io.Reader, w io.Writer, totalPlaintextSize int64) error

func (*GcmService) Encrypt

func (g *GcmService) Encrypt(r io.Reader, w io.Writer, totalPlaintextSize int64) error

type HmacService

type HmacService struct {
	// contains filtered or unexported fields
}

func NewHmacService

func NewHmacService(shareCode string) *HmacService

func (*HmacService) Sign

func (h *HmacService) Sign(data, salt []byte) []byte

func (*HmacService) Verify

func (h *HmacService) Verify(data, signature, salt []byte) bool

Jump to

Keyboard shortcuts

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