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
.
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_decrypt(const GFC* gfc, uint64_t m);
uint64_t gfc_encrypt(const 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))
assert all(perm.inv(perm[i]) == i for i in 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
pygfc-0.2.1.tar.gz
(44.4 kB
view hashes)
Built Distributions
Close
Hashes for pygfc-0.2.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcfbd755b9962730b3cedb1bbfb699aac3baac5da519434ad77e6789888e0228 |
|
MD5 | 1e449b45c6d8889831511b578ec4f570 |
|
BLAKE2b-256 | 2443efe66c7f1b674578aff6f5ecfb74b771949c0ab2c906069136f4a103facf |
Close
Hashes for pygfc-0.2.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9237c82ad490e5e31c3adbf8f74637da4b47959ed41ff657d2c18c622a505b8 |
|
MD5 | fe2b82d0e123e128848c441f3d20c83a |
|
BLAKE2b-256 | 9a6896b1ae818c6237b005c795d9fcd03a61e43b5d018995c8f130039864cf4b |
Close
Hashes for pygfc-0.2.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e235d6fe829058f987ecc303ec509bec5b6b609611043bef8741aa3e7a3613 |
|
MD5 | b6d2ccf406fa8d3f8beb1fc45dd09902 |
|
BLAKE2b-256 | 26bbe5e6a7b1e6127bdbcab088a318158fc90e59aff058c66f3f70ed9ef8f5d4 |
Close
Hashes for pygfc-0.2.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54bcae4ef9959f173f84ee34f459ec39faa078d9976ac4cb9670f2beb9e00c32 |
|
MD5 | 8fbd9b797b0739df603cbe9d40cf7ddd |
|
BLAKE2b-256 | e67b261755bccd4c292bbbe608d26b73a80db03f8752b13b735b921af5382ef2 |
Close
Hashes for pygfc-0.2.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c8e5e60a50401fb88c56eb71e2619ba3aff40530ae9f23bdfe5f0b9fecb7562 |
|
MD5 | 62828e60ddcafc7eb892b3d27304bbfb |
|
BLAKE2b-256 | 72678a595608ada7448737b0a5d7bce14a7c63d30b4dc97e316014b67b63e4ae |
Close
Hashes for pygfc-0.2.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d544fa282e9829102d5fcb2d28394c910bc7709182dd8526c0ea611aa626af57 |
|
MD5 | 7bba16941349505d2d8901a8a4ebe523 |
|
BLAKE2b-256 | 092535822ad1d13f5596d7ff5a5cf09f3479cf8b2f8053b4548c1078d694d053 |
Close
Hashes for pygfc-0.2.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a653c8242cee851466d5875a14319815165d3582828d36f23403f0ae8b5a79af |
|
MD5 | cd1b1e980797d98b1df970fbf129fe7e |
|
BLAKE2b-256 | 4664ac603501c7a8252273bc94468f090a4a321e5c88f1ca96be4fd12c55f322 |
Close
Hashes for pygfc-0.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc26afa64e7fd923bd3ba20a98047fac488994f10b8fb8ac680c8710ada3898a |
|
MD5 | 32ed6017bc36954cacff75152f973a12 |
|
BLAKE2b-256 | 8ff639dcc4371068502a30b32c7099d3323e3337d2e7d65b3d71c45fc779f834 |
Close
Hashes for pygfc-0.2.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d619e094afee6c4263a7795c4fc99b5058b256da943056e52b9b807806d96c80 |
|
MD5 | 2b255205e38b0d990b1d1aa5fb9f09c6 |
|
BLAKE2b-256 | 333ca59ae4571e439141e09f870054e2c9fc0302f07d4907f568640f2f77b22a |
Close
Hashes for pygfc-0.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 035b7433fe7d3356aac21d2457694e6054db8cef7b8e1bfc6fb02f8e3f5e68d7 |
|
MD5 | 369d477b4124ac9550462080d0a80011 |
|
BLAKE2b-256 | ca500012f68675c7b62c2f4f885bdc08ede400b6a41779a2aae0ccf58fe585e2 |