zipher

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const PageSize = 256 //1024 * 1024

Variables

This section is empty.

Functions

func AESDecryptFileTo added in v1.1.0

func AESDecryptFileTo(cipherFile string, plainFile string, passPhrase string)

func AESEncryptFile

func AESEncryptFile(plainFile string, cipherFile string, passphrase string)

func AESEncryptToFile added in v1.1.0

func AESEncryptToFile(cipherFile string, text string, passPhrase string)

func AESdecipher

func AESdecipher(cipherfile string, passphrase string) (plaintext string)

func AESencipher

func AESencipher(data []byte, key []byte) []byte

AES encryption. Key needs to be at least 32 bytes

func CreateMD5Hash

func CreateMD5Hash(key string) string

func CreateSCryptHash

func CreateSCryptHash(data []byte, saltlen, keylen int) (shash string, err error)

keylen is the length of the hash returned

func DecryptDir

func DecryptDir(indir string, key string) (outdir string)

func DecryptFile

func DecryptFile(infile string, outfile string, key string)

func DecryptTask

func DecryptTask(wg *sync.WaitGroup, currentTasks []fs.DirEntry, key string, indir string, outdir string)

func EncryptDir

func EncryptDir(indir string, key string) (outdir string)

func EncryptTask

func EncryptTask(wg *sync.WaitGroup, currentTasks []fs.DirEntry, key string, indir string, outdir string)

Types

type AnotherStreamCipher

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

func CreateAnotherStreamCipher

func CreateAnotherStreamCipher(key string) AnotherStreamCipher

func CreateAnotherStreamCipherWithNonce

func CreateAnotherStreamCipherWithNonce(key string, nonce int32) AnotherStreamCipher

CreateAnotherStreamCipherWithNonce Nonce will be read from encrypted file

func (*AnotherStreamCipher) Decrypt

func (cipher *AnotherStreamCipher) Decrypt(cipherindicies []int32) []byte

func (*AnotherStreamCipher) Encrypt

func (cipher *AnotherStreamCipher) Encrypt(plaintext string) (cipherindicies []int32)

func (*AnotherStreamCipher) GetNonce

func (cipher *AnotherStreamCipher) GetNonce() int32

type Book

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

func GenerateBook

func GenerateBook(key string, nonce int32) Book

func NewBook

func NewBook(key string) Book

func (*Book) AddPage

func (book *Book) AddPage()

func (*Book) Decrypt

func (book *Book) Decrypt(cipherindicies []int) []byte

func (*Book) Encrypt

func (book *Book) Encrypt(plaintext string) []int

func (*Book) EncryptByteArray

func (book *Book) EncryptByteArray(plainbytes []byte) []int

func (*Book) EncryptFile

func (book *Book) EncryptFile(infile string, outfile string)

func (*Book) GetNonce

func (book *Book) GetNonce() int32

Temporary helper function

type BookCipher

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

func CreateBookCipher

func CreateBookCipher(key string, bksize int32, rng_range int32) BookCipher

func CreateBookCipherWithNonce

func CreateBookCipherWithNonce(key string, bksize int32, rng_range int32, nonce int32) BookCipher

CreateBookCipherWithNonce Nonce will be read from encrypted file

func CreateLargeBookCipher

func CreateLargeBookCipher(key string, rng_range int32) BookCipher

func CreateLargeBookCipherWithNonce

func CreateLargeBookCipherWithNonce(key string, rng_range int32, nonce int32) BookCipher

CreateLargeBookCipherWithNonce Nonce will be read from encrypted file

func (*BookCipher) Decrypt

func (cipher *BookCipher) Decrypt(cipherindicies []int32) []byte

func (*BookCipher) Encrypt

func (cipher *BookCipher) Encrypt(plaintext string) []int32

type Page

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

type StreamCipher

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

func CreateStreamCipher

func CreateStreamCipher(key string, rng_range int32) StreamCipher

func CreateStreamCipherWithNonce

func CreateStreamCipherWithNonce(key string, rng_range int32, nonce int32) StreamCipher

CreateStreamCipherWithNonce Nonce will be read from encrypted file

func (*StreamCipher) Decrypt

func (cipher *StreamCipher) Decrypt(cipherindicies []int32) []byte

func (*StreamCipher) Encrypt

func (cipher *StreamCipher) Encrypt(plaintext string) (cipherindicies []int32)

func (*StreamCipher) GetNonce

func (cipher *StreamCipher) GetNonce() int32

Temporary helper function for testing

Jump to

Keyboard shortcuts

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