rwcipher

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: GPL-3.0 Imports: 10 Imported by: 1

README

rwcipher

Read and write password-encrypted files in go

This module performs encryption and decryption in RAM, meaning there are performance consequences (i.e. swapping) if you encrypt/decrypt a file larger than you have available RAM. If performing multple encryptions concurrently, consider the cumulative memory usage to avoid OOM panics.

Documentation

Overview

Read and write asynchronously to encrypted files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt added in v1.0.0

func Decrypt(enc string, dst string, pr PasswordReader) (err error)

Read an encrypted file enc is the encrypted file path dst is the decrypted file path destination pr is only used for testing, and should be nil

func Encrypt added in v1.0.0

func Encrypt(plain string, dst string, pr PasswordReader) (err error)

Encrypt a plaintext file with a password from stdin plain is the plaintext file path dst is the destination filepath for the encrypted file pr is only used for testing, and should be nil

Types

type PasswordReader added in v1.0.0

type PasswordReader interface {
	ReadPassword() ([]byte, error)
}

Returns a password string

type StdInPasswordReader added in v1.0.0

type StdInPasswordReader struct {
}

func (StdInPasswordReader) ReadPassword added in v1.0.0

func (spr StdInPasswordReader) ReadPassword() ([]byte, error)

Directories

Path Synopsis
demo module

Jump to

Keyboard shortcuts

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