/libFPE

The FPE library - open source cryptographic library with Format Preserving Encryption implementations in C/C++

Primary LanguageC++

Format Preserving Encryption

A fast and portable C++ library for Format Preserving Encryption which currently implements:

Installations

Required libraries

C++ compiler with C++14 support. There are several library dependencies including Boost, Miracl, cryptoTools. Our code has been tested on both Windows (Microsoft Visual Studio) and Linux. To install the required libraries:

  • windows: open PowerShell, cd ./cryptoTools/thirdparty/win, and .\getBoost.ps1 .\getMiracl.ps1
  • linux: cd ./thirdparty/linux, and bash all.get.

Building the Project

After cloning project from git,

Windows:
  1. build cryptoTools and libFPE in order (cd libFPE/thirdparty/linux/, bash all.get, cd ../.. && cmake . && make, cd .. && cmake . && make

  2. main project is frontend

  3. run frontend project

Linux:
  1. make (requirements: CMake, Make, g++ or similar)
  2. for test: ./bin/frontend.exe

Usage

FF3 ff3(userKey); //assign encryption key for AES-NI
u8* cipherText = ff3.encrypt(plainText, tweak, len, radix);
u8* decryptText = ff3.decrypt(cipherText, tweak, len, radix);

Help

For any questions on building or running the library, please contact Ni Trieu at trieun at oregonstate dot edu