Documentation ¶
Index ¶
- Constants
- func AESDecryptFileTo(cipherFile string, plainFile string, passPhrase string)
- func AESEncryptFile(plainFile string, cipherFile string, passphrase string)
- func AESEncryptToFile(cipherFile string, text string, passPhrase string)
- func AESdecipher(cipherfile string, passphrase string) (plaintext string)
- func AESencipher(data []byte, key []byte) []byte
- func CreateMD5Hash(key string) string
- func CreateSCryptHash(data []byte, saltlen, keylen int) (shash string, err error)
- func DecryptDir(indir string, key string) (outdir string)
- func DecryptFile(infile string, outfile string, key string)
- func DecryptTask(wg *sync.WaitGroup, currentTasks []fs.DirEntry, key string, indir string, ...)
- func EncryptDir(indir string, key string) (outdir string)
- func EncryptTask(wg *sync.WaitGroup, currentTasks []fs.DirEntry, key string, indir string, ...)
- type AnotherStreamCipher
- type Book
- type BookCipher
- func CreateBookCipher(key string, bksize int32, rng_range int32) BookCipher
- func CreateBookCipherWithNonce(key string, bksize int32, rng_range int32, nonce int32) BookCipher
- func CreateLargeBookCipher(key string, rng_range int32) BookCipher
- func CreateLargeBookCipherWithNonce(key string, rng_range int32, nonce int32) BookCipher
- type Page
- type StreamCipher
Constants ¶
View Source
const PageSize = 256 //1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func AESDecryptFileTo ¶ added in v1.1.0
func AESEncryptFile ¶
func AESEncryptToFile ¶ added in v1.1.0
func AESdecipher ¶
func AESencipher ¶
AES encryption. Key needs to be at least 32 bytes
func CreateMD5Hash ¶
func CreateSCryptHash ¶
keylen is the length of the hash returned
func DecryptDir ¶
func DecryptFile ¶
func DecryptTask ¶
func EncryptDir ¶
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 (*Book) EncryptByteArray ¶
func (*Book) EncryptFile ¶
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 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
Click to show internal directories.
Click to hide internal directories.