cryptostore

package
v0.0.0-...-b425644 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

README

Crypter

Goal

Store encrypted BLOBs of data for multiple users on a server. New users can be added by all existing users, BLOBs can be changed by all users.

Create user

  • All user data is stored in a user specific directory $ROOT/users/<login>
  • Creating of users requires the login name and a user specific password
  • A new 4096 bit RSA keypair is created, the public key is stored unencrypted, the privat key is encrypted with AES and the provided password

Store BLOB for a specific user

  • a new 32 byte secret AES key is created
  • the BLOB is encrypted and stored with the generated key `$ROOT/users//data.
  • the generated key is encrypted with the public key of the user

Read BLOB by user

  • the private RSA key of the user is decrypted by the user provided password
  • the secret key of the BLOB is decrypted with private RSA key
  • the BLOB es decrypted withg the secret key

Approach

All users have secret 32 byte keys which are provided with each request.

Requirements

All stored BLOBs need to have some version (or checksum) in their names.

Documentation

Index

Constants

View Source
const DefaultBits = 2048

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(root string) *Store

func (*Store) CreateUser

func (store *Store) CreateUser(login, password string) (u *User, e error)

func (*Store) Get

func (store *Store) Get(key string, login string, secret string) (b []byte, e error)

func (*Store) Put

func (store *Store) Put(key string, value []byte, login string) error

func (*Store) UserExists

func (store *Store) UserExists(login string) bool

func (*Store) Users

func (store *Store) Users() (users []*User, e error)

type StoreOptions

type StoreOptions struct {
	Encrypt bool
	Encode  bool
}

type User

type User struct {
	Login string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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