fpe

package
v0.0.0-...-071f45e Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fpe provides an implementation of the FF1 and FF3 mode of operation for format-preserving encryption. See NIST SP 800-38G (http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf)

Package fpe provides an implementation of the FF1 and FF3 mode of operation for format-preserving encryption. See NIST SP 800-38G (http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf).

Package fpe provides an implementation of the FF1 and FF3 mode of operation for format-preserving encryption. See NIST SP 800-38G (http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToNumeralString

func BytesToNumeralString(bytes []byte) []uint16

BytesToNumeralString takes a byte array and returns its representation as a string of numerals.

func NewFF1Decrypter

func NewFF1Decrypter(aesBlock cipher.Block, cbcMode cipher.BlockMode, tweak []byte, radix uint32) cipher.BlockMode

NewFF1Decrypter returns a BlockMode which decrypts in FF1 mode, using the given Block and BlockMode. The given block must be AES, the BlockMode must be CBC, the tweak must match the tweak used to encrypt the data, and the radix must be in [2..2^16].

func NewFF1Encrypter

func NewFF1Encrypter(aesBlock cipher.Block, cbcMode cipher.BlockMode, tweak []byte, radix uint32) cipher.BlockMode

NewFF1Encrypter returns a BlockMode which encrypts in FF1 mode, using the given Block and BlockMode. The given block must be AES, the BlockMode must be CBC, the length of tweak must be in [0..maxTweakLenFF1], and the radix must be in [2..2^16].

func NewFF3Decrypter

func NewFF3Decrypter(aesBlock cipher.Block, tweak []byte, radix uint32) cipher.BlockMode

NewFF3Decrypter returns a FpeMode which decrypts in FF3 mode, using the given Block. The given block must be AES, the radix must be in [2..2^16], the length of tweak must be 64 bits and the tweak must be the same as the tweak used to encrypt the data.

func NewFF3Encrypter

func NewFF3Encrypter(aesBlock cipher.Block, tweak []byte, radix uint32) cipher.BlockMode

NewFF3Encrypter returns a BlockMode which encrypts in FF3 mode, using the given Block. The given block must be AES, the length of tweak must be 64 bits, and the radix must be in [2..2^16].

func NumeralStringToBytes

func NumeralStringToBytes(numeralString []uint16) []byte

NumeralStringToBytes takes a string of numerals, each of them is in [0..2^16[. It returns the representation of numeralString as a byte array, where each numeral is stored using 2 bytes.

func RevB

func RevB(x []byte) []byte

RevB takes a byte string x returns the byte string that consists of the bytes of x in reverse order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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