gocryptomator

package module
v0.0.0-...-767ef52 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: MIT Imports: 20 Imported by: 0

README

gocryptomator

Cryptomator access from golang

Documentation

Index

Constants

View Source
const (
	CRYPTOMATOR_HEADER_SIZE       = 88
	CRYPTOMATOR_BLOCK_HEADER_SIZE = 48
	CRYPTOMATOR_BLOCK_SIZE        = 32 * 1024
	CRYPTOMATOR_FULL_BLOCK_SIZE   = CRYPTOMATOR_BLOCK_HEADER_SIZE + CRYPTOMATOR_BLOCK_SIZE
)
View Source
const (
	// CryptomatorMasterkey is the default filename for a vault related data
	CryptomatorMasterkey = "masterkey.cryptomator"
)

Variables

This section is empty.

Functions

func KeyUnwrap

func KeyUnwrap(block cipher.Block, ciphertext []byte) ([]byte, error)

KeyUnwrap implements NIST key unwrapping; it unwraps a content encryption key (cek) with the given block cipher.

func KeyWrap

func KeyWrap(block cipher.Block, cek []byte) ([]byte, error)

KeyWrap implements NIST key wrapping; it wraps a content encryption key (cek) with the given block cipher.

Types

type CryptomatorNode

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

CryptomatorNode handles the os.FIleInfo interface

func CreateNodeFromFileInfo

func CreateNodeFromFileInfo(fileinfo os.FileInfo, vault *CryptomatorVault, parentDirID string) *CryptomatorNode

func (*CryptomatorNode) DirUUID

func (n *CryptomatorNode) DirUUID() (string, error)

func (*CryptomatorNode) IsDir

func (n *CryptomatorNode) IsDir() bool

func (*CryptomatorNode) ModTime

func (n *CryptomatorNode) ModTime() time.Time

func (*CryptomatorNode) Mode

func (n *CryptomatorNode) Mode() os.FileMode

func (*CryptomatorNode) Name

func (n *CryptomatorNode) Name() string

func (*CryptomatorNode) Size

func (n *CryptomatorNode) Size() int64

func (*CryptomatorNode) Sys

func (n *CryptomatorNode) Sys() interface{}

type CryptomatorVault

type CryptomatorVault struct {
	Version                int    `json:"version"`
	ScryptSaltString       string `json:"scryptSalt"`
	ScryptSalt             []byte
	ScryptCostParam        int    `json:"scryptCostParam"`
	ScryptBlockSize        int    `json:"scryptBlockSize"`
	PrimaryMasterKeyString string `json:"primaryMasterKey"`
	PrimaryMasterKey       []byte
	HmacMasterKeyString    string `json:"hmacMasterKey"`
	HmacMasterKey          []byte
	VersionMacString       string `json:"versionMac"`
	VersionMac             []byte
	// contains filtered or unexported fields
}

CryptomatorVault holds the data for a Cryptomator vault

func OpenCrytomatorVault

func OpenCrytomatorVault(vaultDirectory string, password []byte) (*CryptomatorVault, error)

OpenCrytomatorVault opens an existing vault in the given directory

func (*CryptomatorVault) DecryptFilename

func (vault *CryptomatorVault) DecryptFilename(encryptedFilename string, parentDirID string) (string, error)

DecryptFilename returns the decrypted filenames

func (*CryptomatorVault) EncryptDirectoryName

func (vault *CryptomatorVault) EncryptDirectoryName(plainFilename string, parentDirID string) (string, error)

EncryptDirectoryName returns the decrypted filenames

func (*CryptomatorVault) EncryptFilename

func (vault *CryptomatorVault) EncryptFilename(plainFilename string, parentDirID string) (string, error)

EncryptFilename returns the decrypted filenames

func (*CryptomatorVault) EncryptedPathFor

func (vault *CryptomatorVault) EncryptedPathFor(uuid string, fullPath bool) (string, error)

EncryptedPathFor returns the encrypted path for a given uuid

func (*CryptomatorVault) List

func (vault *CryptomatorVault) List(pathUUID string) ([]*CryptomatorNode, error)

List returns a list of FileInfo for the given UUID

func (*CryptomatorVault) ReadDir

func (vault *CryptomatorVault) ReadDir(path string) ([]os.FileInfo, error)

ReadDir returns the decrypted filenames

func (*CryptomatorVault) Walk

func (vault *CryptomatorVault) Walk() error

Jump to

Keyboard shortcuts

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