fieldcipher

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MAGIC = "FCMN"

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(data, baseKey []byte) (string, error)

func AESEncrypt

func AESEncrypt(data, baseKey []byte) (string, error)

func CipherPathCombine

func CipherPathCombine(args ...string) string

func CipherPathUnmangle

func CipherPathUnmangle(path string) string

func GenerateKey

func GenerateKey() ([]byte, error)

Types

type Cipher

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

func MakeCipher

func MakeCipher(publicKeys []*openpgp.Entity) *Cipher

func MakeCipherFromASCIIArmoredKeys

func MakeCipherFromASCIIArmoredKeys(publicKeys []string) *Cipher

func (*Cipher) EncryptJSONFields

func (c *Cipher) EncryptJSONFields(jsonData string, key []byte, skipFields []string) (map[string]interface{}, error)

func (*Cipher) GenerateEncryptedPacket

func (c *Cipher) GenerateEncryptedPacket(data map[string]interface{}, skipFields []string) (*CipherPacket, error)

func (*Cipher) PGPEncryptToBase64

func (c *Cipher) PGPEncryptToBase64(data []byte, filename string) (string, error)

type CipherPacket

type CipherPacket struct {
	EncryptedKey  string `` /* 710-byte string literal not displayed */
	EncryptedJSON map[string]interface{}
}

type Decipher

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

func MakeDecipher

func MakeDecipher(privateKey openpgp.EntityList) (*Decipher, error)

func MakeDecipherWithASCIIPrivateKey

func MakeDecipherWithASCIIPrivateKey(privateKey string) (*Decipher, error)

func (*Decipher) DecipherPacket

func (d *Decipher) DecipherPacket(packet CipherPacket) (*DecipherPacket, error)

func (*Decipher) DecryptJsonFields

func (d *Decipher) DecryptJsonFields(data map[string]interface{}, baseKey []byte) ([]UnmatchedField, map[string]interface{}, error)

func (*Decipher) Unlock

func (d *Decipher) Unlock(password string) bool

type DecipherPacket

type DecipherPacket struct {
	DecryptedData   map[string]interface{}
	JSONChanged     bool `example:"false"`
	UnmatchedFields []UnmatchedField
}

type UnmatchedField

type UnmatchedField struct {
	Expected string `example:"/data/Test/0/test/"`
	Got      string `example:"/data/Test/0/name/"`
}

Jump to

Keyboard shortcuts

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