Code Monkey home page Code Monkey logo

libfte's Introduction

libfte

Build Status

Overview

Format-Transforming Encryption (FTE) is a cryptographic primitive explored in the paper Protocol Misidentification Made Easy with Format-Transforming Encryption [1]. FTE allows a user to specify the format of their ouput ciphertexts using regular expressions. The libfte library implements the primitive presented in [1].

If you are interested in the proxy system that uses FTE to bypass DPI systems, please see fteproxy.

Dependencies

Installation

To install libfte as a python module, please do the following:

python setup.py install

You can verify that libfte was built correctly by running:

python setup.py test

To verify that libfte was installed correctly, try running one of the scripts in the examples/ directory.

Example Usage

The following is an example usage of libfte.

import regex2dfa
import fte.encoder
 
regex = '^(a|b)+$'
fixed_slice = 512
input_plaintext = 'test'
 
dfa = regex2dfa.regex2dfa(regex)
fteObj = fte.encoder.DfaEncoder(dfa, fixed_slice)
 
ciphertext = fteObj.encode(input_plaintext)
[output_plaintext, remainder] = fteObj.decode(ciphertext)
 
print 'input_plaintext='+input_plaintext
print 'ciphertext='+ciphertext[:16]+'...'+ciphertext[-16:]
print 'output_plaintext='+output_plaintext

And the ouput of the above script would be the following, where the ouput ciphertext is a fixed_slice-length string consisting of the characters a and b, as defined by the regex variable.

input_plaintext=test
ciphertext=aaaaaaaabaaaaaba...aabbbbbbbbaababb
output_plaintext=test

References

[1] Protocol Misidentification Made Easy with Format-Transforming Encryption Kevin P. Dyer, Scott E. Coull, Thomas Ristenpart and Thomas Shrimpton

libfte's People

Contributors

ctanzini avatar kpdyer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.