gobooj

package module
v0.0.0-...-b3b09e0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2017 License: MIT Imports: 8 Imported by: 1

README

GoBooj

Bruce Schneier's Boojum in Go

Boojum is a concept presented in Schneier's Cryptography Engineering book, which is intended to somewhat mitigate the threat posed by cold-boot attacks. Since DRAM cells tend to degrade with similar rates on similar addressing rows, Boojum tries to spray key material over different sections of the address space and then bring them back together.

I had a need for something like this in my Wraith password manager project, but was unable to find any implementations. So, like a dumbass, I rolled my own.

Usage

GoBooj spins up a goroutine that runs in the background to handle constant rotation of memory cells. You must provide an error handling function, since this background task may fail asynchronously during rotation.

// Create Instance
booj := gobooj.Init(func(err error) {
    fmt.Printf( "Oh noes! The FBI is after muh LUNIX! error %s\n",err.Error())
})

// Set Key Material
booj.Set([]byte("hunter2"))

// Get Key Material
keyBytes, _ := booj.Get()

doSomething(keyBytes)

// Ok, done. Cleanup this mess, overwrite all key material
booj.Cleanup()

Caveats

I am not a professional cryptographer. This is just a pet project. There are very likely all kinds of things wrong with this implementation. You should assume that if you use this to store sensitive key material, you will get owned immediately.

Documentation

Index

Constants

View Source
const I_LOCATION = 1031 * 281 // location of xor'ed i
View Source
const MAX_LENGTH_BYTES = 1024
View Source
const RANDOM_SPACE_LENGTH = 1024 * 2048
View Source
const R_LOCATION = 1031 * 1279 // location of first to hash
View Source
const S_LOCATION = 1031 * 1987 // location of second to hash

Variables

This section is empty.

Functions

This section is empty.

Types

type Boojum

type Boojum interface {
	Set([]byte) error
	Get() ([]byte, error)
	Cleanup() error
}

func CreateNaiveBoojum

func CreateNaiveBoojum(f ErrorHandler) Boojum

func Init

func Init(f ErrorHandler) Boojum

type ErrorHandler

type ErrorHandler func(error)

type NaiveBoojum

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

func (*NaiveBoojum) Cleanup

func (b *NaiveBoojum) Cleanup() error

func (*NaiveBoojum) Get

func (b *NaiveBoojum) Get() ([]byte, error)

func (*NaiveBoojum) Set

func (b *NaiveBoojum) Set(ba []byte) error

Jump to

Keyboard shortcuts

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