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.0.tar.gz
(43.9 kB
view hashes)
Built Distributions
Close
Hashes for pygfc-0.2.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e985f33327db3cff4f2d444422ec9f01c27324649317094bea086e99b7965793 |
|
MD5 | adaa08b57c6ffef0b8884aada385d878 |
|
BLAKE2b-256 | cbe224ea7853bce863586b4e14be79d2debd6092520f29af7033088c3f6a3655 |
Close
Hashes for pygfc-0.2.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac0dff962a63bc00dbb7f68b7a382fb373965af00563691f5bc6f7a836760a58 |
|
MD5 | 5225b00a941931e2aa6aa02c35d4324f |
|
BLAKE2b-256 | 0003a158dd753c815707a2de4484a6f7bd037a7b0b20ef42cdf0839c8d048d61 |
Close
Hashes for pygfc-0.2.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd2ba024f7e9cad90f9d4d69a951d2709cd2f3e3cb1c05dabb74756e60446841 |
|
MD5 | 0f6c78f339b95eb2779319bf17488b53 |
|
BLAKE2b-256 | a19756a1c8fc28e273665e283063c84d46e18eb169932fa8b8ed08cf40e171d7 |
Close
Hashes for pygfc-0.2.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d3d29dd3a0bb4bae539e0697a46885fc861ca70b2ccabb55f754c07f04e0fc2 |
|
MD5 | 291955b5d2a9a4e8e1163e580f5cdfb3 |
|
BLAKE2b-256 | 067813dfd7c2ca8475126de8e0d19d2c8debbd3b06278cd814f5b9a0625e9351 |
Close
Hashes for pygfc-0.2.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3c2fc0dbf0adda34f57b61c85dfb63fc4f031d431173226f4fc1f68cbd022f0 |
|
MD5 | 9eb4efc2ffd18dcd74ce4ba16f307326 |
|
BLAKE2b-256 | 0e4cfdb096955ae3cc05dde3525d3ce17e883fe0e6d732b45a8e043576283cfb |
Close
Hashes for pygfc-0.2.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed5aec318012e31b685e1de9e39eb2878dad5c796ac132d3dba646202450bf1 |
|
MD5 | 068d2532ec194c24b31e481deef035dc |
|
BLAKE2b-256 | 4d4187b2b2f4cfda26cc9c83fea17af4f1e74c33b985c056d4de4c8c1c4db40b |
Close
Hashes for pygfc-0.2.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 219a6edb1f523ffddc073de91a583a98248c0a81529cf0b78080886fb96b4ef6 |
|
MD5 | 42610d78304e6e7dca06759209da808f |
|
BLAKE2b-256 | 1ea0fab9773c76a661c00a4d4d45aa12cc625dd21cee43d1feec12e08e9921fd |
Close
Hashes for pygfc-0.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e807cf8e0e3e7505ebcba60f626c355732753b307545177fa46e4d3dba884b89 |
|
MD5 | 8ffce32eb71ad092e85990f1413f0078 |
|
BLAKE2b-256 | 9353d1fc663b1c6a403e89df0f1de353b43e5dd93e6a02a9ee23b3de0c6fc2dd |
Close
Hashes for pygfc-0.2.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a3ffee3164758d3c188452b42ee960e009c35bcfccee3c35a2ded743bf32f2 |
|
MD5 | f8f2fa7b191d79b30177b5d591b742fd |
|
BLAKE2b-256 | add577d832315188d89cc54d360717d989e2d0d7edd85f8922da1a279a30e98c |
Close
Hashes for pygfc-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ac1f61d65698460de823d52fa5d92263c02ba449ebeedb4c331ad77b9546c30 |
|
MD5 | 55992c5136359e002c845e00062aba5a |
|
BLAKE2b-256 | 536e97adaebe941b9a31ead5d614cdd7fd19db951d98a4c0978c36b7cca19697 |