FileEncryption

package module
v0.0.0-...-1dfc920 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: MIT Imports: 8 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

How to install

  • Get the library using:
go get github.com/Tiked/FileEncryption
  • Import it:
import "github.com/Tiked/FileEncryption"

How to use it

package main
import "github.com/Tiked/FileEncryption"

func main() {
  // First initialize the chipher with your key. use a 32 bytes slice
  FileEncryption.InitializeBlock([]byte("a very very very very secret key"))
  
  // Now encrypt a file with its path
  err := FileEncryption.Encrypter("/home/desktop/data.txt")
  if err != nil {
    panic(err.Error())
  }
  // Now you should see data.txt.enc in your desktop
  
  // To decrypt it
  err = FileEncryption.Decrypter("/home/desktop/data.txt.enc")
  if err != nil {
    panic(err.Error())
  }
  // Now you should see data.txt in your desktop
  
}

Features

  • Encrypts large files using stream encryption
  • Per-file unique IV handling

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ext = ".enc"

Ext is the encrypted appended extension

Functions

func Decrypter

func Decrypter(path string) (err error)

Decrypter decryps a file given its filepath

func Encrypter

func Encrypter(path string) (err error)

Encrypter encrypts a file given its filepatth

func InitializeBlock

func InitializeBlock(myKey []byte)

InitializeBlock Sets up the encription with a key

Types

This section is empty.

Jump to

Keyboard shortcuts

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