GithubHelp home page GithubHelp logo

libfte's People

Contributors

ctanzini avatar irdan avatar kpdyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libfte's Issues

Include encryption within encode call

We are currently not calling the fte.encrypt function when we call encode, this is due to poor encapsulation with the previous fte.record_layer calls.

Memory leak in fte.encrypt

The following script highlights a memory leak in libfte:

import fte.encoder

regex = '^(a|b)+$'
fixed_slice = 512
input_plaintext = 'test'

fteObj = fte.encoder.RegexEncoder(regex, fixed_slice)
for trials in range(10000):
  fteObj.encode(input_plaintext)

Using valgrind, we get:

$ valgrind --tool=memcheck --suppressions=valgrind-python.supp --leak-check=full --show-reachable=yes python -E -tt test.py
...
==11293== LEAK SUMMARY:
==11293==    definitely lost: 412 bytes in 2 blocks
==11293==    indirectly lost: 1,043 bytes in 24 blocks
==11293==      possibly lost: 27,220 bytes in 77 blocks
==11293==    still reachable: 3,259,770 bytes in 567 blocks
==11293==         suppressed: 0 bytes in 0 blocks

Increasing/decreasing the valid trials in the test script results in an increase/decrease in the still reachable bytes, as reported by valgrind.

This specific bug manifests itself on fteproxy Tor bridges when run for many many months. It appears that only a few bytes are leaked by each fte.encode call.

Use of ECB mode

The AES block cipher mode that is currently being used is ECB. This strikes me as an unusual design decision that I have not seen justification for in the publication, documentation, or code.

ECB mode is perhaps the most difficult block cipher mode to use while still maintaining the security properties that AES seeks to provide.

My intention in filing this issue is to prompt changing to a new block cipher mode or allow the rationale to be more clearly documented.

Odd Behavior with Groups of Strings of Differing Lengths

This may be an issue in regex2dfa but I came across it while exploring the docs/ in this project...
This produces behaviors I find unexpected and I believe it has something to do with mixing items in a regex grouping of odd and even lengths.

import regex2dfa
import fte.encoder

regex = '^(ab|d)+$'
fixed_slice = 512
input_plaintext = 'THIS IS A TEST'

dfa = regex2dfa.regex2dfa(regex)
fteObj = fte.encoder.DfaEncoder(dfa, fixed_slice)

ciphertext = fteObj.encode(input_plaintext)

print 'ciphertext (%s) = %s' % (str(len(ciphertext)), ciphertext)

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.