crypt

package
v0.0.0-...-6644fb6 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Insert

func Insert(password string, description string) error

Insert takes a user password and description input, encrypts it, and stores it in .cache.

func Ls

func Ls() error

Ls prompts a user for a password, reads the .cache file, unmarshals it, and returns the password(s).

Types

type File

type File struct {
	Password    string `json:"password"`
	Description string `json:"description"`
	CypherText  string
	Method      string
}

File is used to pass pass to the receiver functions to handle encryption and decryption of user passwords.

func (*File) Auth

func (f *File) Auth() (string, error)

Auth takes a user password and method from caller and

uses this to either encrypt an insert or decrypt on Ls using the user

provided passphrase.

func (*File) DecryptPwd

func (f *File) DecryptPwd(password, cypherText string) (string, error)

DecryptPwd takes a user provided passphrase and decrypts the password(s) from .cache.

func (*File) EncryptPwd

func (f *File) EncryptPwd(password string) (string, error)

EncryptPwd takes a user provided passphrase and encrypts the password (to be stored in .cache).

Jump to

Keyboard shortcuts

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