Discover Packages
github.com/4zv4l/chacha
package
module
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Mar 18, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
README
Documentation
Overview
Index
Constants
Variables
Functions
DecryptChaCha20(key, nonce, ct)
DecryptFile(in, out, key, nonce)
EncryptChaCha20(key, nonce, pt)
EncryptFile(in, out, key, nonce)
Types
Source Files
README
README
¶
chacha
Easily encrypt/decrypt data or file using chacha20
to use in your project
import "github.com/4zv4l/chacha"
in terminal
go get github.com/4zv4l/chacha
variable
There is a :
var Buff_size int = 2048
Allowing to change the buffer size (can increase speed when enc/dec files)
Expand ▾
Collapse ▴
Documentation
¶
Package chacha is a layer to the package golang.org/x/crypto/chacha20poly1305
allowing to easily encrypt/decrypt data or files
Variables
func DecryptChaCha20(key, nonce, ct []byte) ([]byte, error)
func DecryptFile(in, out *os.File, key, nonce string) error
func EncryptChaCha20(key, nonce, pt []byte) ([]byte, error)
func EncryptFile(in, out *os.File, key, nonce string) error
BuffSize is the size of the buffer used when reading from file
it is set to 2048 bytes (2kb) by default
DecryptChaCha20 decrypts ct (cipher text)
using the key and the nonce
return the cipher text or an error
DecryptFile take : input/output file, key and nonce in hex
then decrypt the file and store result in the output file
takes care to change the nonce every time the buffer length is reached
EncryptChaCha20 encrypts pt (plain text)
using the key and the nonce
return the cipher text or an error
EncryptFile takes : input/output file, key and nonce in hex
then encrypt the file and store result in the output file
takes care to change the nonce every time the buffer length is reached
Source Files
¶
Click to show internal directories.
Click to hide internal directories.