Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevincharm/feistel_shuffle_fe
https://github.com/kevincharm/feistel_shuffle_fe
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/kevincharm/feistel_shuffle_fe
- Owner: kevincharm
- License: mit
- Created: 2023-08-13T02:09:05.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-13T02:10:03.000Z (about 1 year ago)
- Last Synced: 2024-04-14T13:46:01.219Z (7 months ago)
- Language: Makefile
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Feistel Shuffle (Fe Edition)
Generalised Feistel cipher (format-preserving encryption) implemented in [Fe](https://fe-lang.org).
JS Spec: https://github.com/kevincharm/gfc-fpe
## Usage
```fe
use feistel_shuffle::encrypt// Shuffle an NFT token id `x`
let x: u256 = 0
let domain: u256 = 10_000
let random_seed: u256 = 0xc7a5d737993796fccf3e283c501bbe000e61d1129dbf31a712d75d1de219ce47
let rounds: u256 = 6
let x_prime: u256 = 1 + encrypt(x - 1, domain, random_seed, rounds)
```