cryptem

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 9 Imported by: 0

README

cryptem

A little tool to simply encrypt files.

I need a simple, short, easy command to encrypt all the content of a folder.
Few options:

  • password
  • delete clear files when encrypting, encrypted files when decrypting
  • scan subfolders
  • decrypt

Note: password must be long exactly 16 chars. Note: cryptem ignores files and folders that start with a dot (.).

Prerequisites:

  • go
  • git

To install, clone the git repo, cd into cmd/cryptem folder and run go install.

# EXAMPLES

# Encrypt all the files inside the folder 
> cryptem -folder . -password "1234567890123456" 

# Encrypt all the files inside the folder 
# delete the originals unencrypted
> cryptem -folder . -password "1234567890123456" -delete

# Encrypt all the files inside the folder
# delete the originals unencrypted
# do the same recursively inside all the subfolders
> cryptem -folder . -password "1234567890123456" -delete -recursive

# Encrypt all the files inside the folder
# overwrite existing .cryptem files
# delete the originals unencrypted
# do the same recursively inside all the subfolders
> cryptem -folder . -password "1234567890123456" -delete -recursive -overwrite

# Adding -decrypt the previous commands perform unencryption

Documentation

Index

Constants

View Source
const (
	EncryptedExtension = ".cryptem"
	Unset              = iota
	ModeEncrypt
	ModeDecrypt
	ScanRecursive
	ScanLocal
	ForceNothing
	ForceDelete
	ForceOverwrite
	ForceDeleteAndOverwrite
)

Variables

View Source
var ErrFileExist = errors.New("file exists")

Functions

func Decrypt

func Decrypt(key, encoded []byte) ([]byte, error)

Decrypt an encoded text with a key

func DecryptFile

func DecryptFile(key []byte, encryptedFilePath, clearFilePath string) error

func Encrypt

func Encrypt(key, data []byte) ([]byte, error)

Encrypt a text with a key

func EncryptFile

func EncryptFile(key []byte, clearFilePath, encryptedFilePath string) error

func HashOfFile

func HashOfFile(filePath string) (string, error)

func IsExisting

func IsExisting(filePath string) (bool, error)

func ProcessFile

func ProcessFile(key []byte, filePath string, force int) (string, error)

func Scan

func Scan(key []byte, folder string, scanmode int, mode int, force int) error

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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