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 ¶
- func BytesToNumeralString(bytes []byte) []uint16
- func NewFF1Decrypter(aesBlock cipher.Block, cbcMode cipher.BlockMode, tweak []byte, radix uint32) cipher.BlockMode
- func NewFF1Encrypter(aesBlock cipher.Block, cbcMode cipher.BlockMode, tweak []byte, radix uint32) cipher.BlockMode
- func NewFF3Decrypter(aesBlock cipher.Block, tweak []byte, radix uint32) cipher.BlockMode
- func NewFF3Encrypter(aesBlock cipher.Block, tweak []byte, radix uint32) cipher.BlockMode
- func NumeralStringToBytes(numeralString []uint16) []byte
- func RevB(x []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToNumeralString ¶
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 ¶
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 ¶
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 ¶
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.
Types ¶
This section is empty.