(Partial) implementation of a Generalized-Feistel Cipher for generating random permutations.
Project description
gfc
Implementation of a Generalized-Feistel Cipher [1, alg. 3] for generating random permutations.
It uses Speck 64/128 as the random function, and can generate permutations up to 2^64
.
The inverse function (Fe^-1
) is currently not implemented.
C API
#include <gfc/gfc.h>
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
from pygfc import Permutation
# Permutation(range, rounds, seed)
perm = Permutation(2 ** 16, 8, 42)
assert set(perm) == set(range(2 ** 16))
Dependencies
The Speck implementation is from madmo/speck and is licensed under the ISC license (MIT-compatible).
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pygfc-0.1.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f6c714054255b64fe7e1097282dba62d8a59aa20a4f35f605454ffde0f60d53 |
|
MD5 | b87fe972c6bbd4e9b16c14bb5e9050fb |
|
BLAKE2b-256 | 7cc97f64f78f147c1cb3a5cd48c038d570c1a4a80e9c33030b13ab9d1753c68a |
Hashes for pygfc-0.1.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a41a1888fae2ae561cbcfc004ffcf1621941fcbf499717dc8e37e82b38c193ac |
|
MD5 | c8ea61875577942f07246c2361b76dca |
|
BLAKE2b-256 | 7291142833269b7b191c110658a5e21cbf0e4bd41aa7d9dd4868c5f59d52b34c |
Hashes for pygfc-0.1.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8790c2e26e31bb3c38e4627c58130386541c841f85f56a62df15ce8632b919b6 |
|
MD5 | 85db9be4f4271d1597963ce9443ad2d5 |
|
BLAKE2b-256 | e0f301669650069dbd90c1cd57f7c7c3ce474b727a5ff6a17ab7c402cc33b6f7 |
Hashes for pygfc-0.1.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab5500dcc811eacf269a7157616afaf5cf1e63c2cfbe212e4ef926ef53ec47a1 |
|
MD5 | 1fbccfab0272d51ab9275cf18a3f1259 |
|
BLAKE2b-256 | c4116fca350cbdab1aecc198581b2af08e2454375b3a8411ae0f63ec96d72e12 |
Hashes for pygfc-0.1.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 912acd3c2315d65c9b8017d362b8ad71e7a396457b45cbca68610089dbf4abc6 |
|
MD5 | 5ff8118f704d5932ed131f43b16fdc58 |
|
BLAKE2b-256 | a1b17d145b6fead141b35042d4ff65e216bc064864ce61db4148d8dfd2e6f4dc |
Hashes for pygfc-0.1.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ff7ce8877bc7184bceb1f7fc13977cb1e288b855a7d6a6f4e47f403e79d1507 |
|
MD5 | cd6f886c8d33e0f4014594f7f29d6fba |
|
BLAKE2b-256 | 807f0de82986cb285bb9d8a609fb20fcd1888f897d18d4c311aeeb1204bef5ca |
Hashes for pygfc-0.1.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55f1e0e62fe9d90774a0db4138f8f6655505bab111fa595a1d73718519a6da06 |
|
MD5 | f9b45ef04c6edb8de92cc3a03f3dc47b |
|
BLAKE2b-256 | a76bce786e256e7a5719f29d7e790107c43f2e0c75a1ba6fb4b8d79f22027c50 |
Hashes for pygfc-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca979b39896c1737f427a637a3fb8fd5e84e23843845d513cc8965811943c040 |
|
MD5 | d5750b96c413eb629650aba79ed991a7 |
|
BLAKE2b-256 | a4c394b48c77741b070369d5f6229a76a0ac4089bfd59843d574e89d08cacd3a |
Hashes for pygfc-0.1.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 621bccd47946d2c3455c2b9a9098a628824c554ace62c7bfa9cd5dae8e0e5d76 |
|
MD5 | 0a059a8bde06c6ab425feb5231456835 |
|
BLAKE2b-256 | 7fad58d685145d25a44d1aed8571d4e999a82aa9e53cb83525b6518e1dff0988 |
Hashes for pygfc-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8619517f621042f1e46bcc92f8c3bffbd5d72f8bdb15fa98103c9e74e581056 |
|
MD5 | 01c92bc414c1695743cadd3891091ec1 |
|
BLAKE2b-256 | 53759d48d185121421c3e2b6169b356ce2ca600769e569dd1ab47ed427002c03 |