Skip to main content

(Partial) implementation of a Generalized-Feistel Cipher for generating random permutations.

Project description

gfc

build

(Partial) implementation of a Generalized-Feistel Cipher [1, alg. 3] for generating random permutations.
It uses Speck 64/128 as the random function.
The Speck implementation is from madmo/speck and is licensed under the ISC license (MIT-compatible).

C API

GFC* gfc_init(uint64_t range, uint64_t rounds, uint64_t seed);
void gfc_destroy(GFC* gfc);
uint64_t gfc_encrypt(GFC* gfc, uint64_t m);

Python API

# Permutation(range, rounds, seed)
perm = Permutation(2 ** 16, 8, 42)
assert set(perm) == set(range(2 ** 16))

References

[1] Black, John, and Phillip Rogaway. "Ciphers with arbitrary finite domains." Cryptographers’ track at the RSA conference. Springer, Berlin, Heidelberg, 2002. https://web.cs.ucdavis.edu/~rogaway/papers/subset.pdf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygfc-0.1.0.tar.gz (36.0 kB view hashes)

Uploaded Source

Built Distributions

pygfc-0.1.0-cp39-cp39-manylinux2010_x86_64.whl (96.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

pygfc-0.1.0-cp39-cp39-manylinux1_x86_64.whl (96.3 kB view hashes)

Uploaded CPython 3.9

pygfc-0.1.0-cp38-cp38-manylinux2010_x86_64.whl (96.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pygfc-0.1.0-cp38-cp38-manylinux1_x86_64.whl (96.1 kB view hashes)

Uploaded CPython 3.8

pygfc-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl (90.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pygfc-0.1.0-cp37-cp37m-manylinux1_x86_64.whl (90.8 kB view hashes)

Uploaded CPython 3.7m

pygfc-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl (90.7 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

pygfc-0.1.0-cp36-cp36m-manylinux1_x86_64.whl (90.7 kB view hashes)

Uploaded CPython 3.6m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page