https://github.com/ilovenooodles/design-block-cipher
Regina is a block cipher that created based on AES and DES and feistel network. It uses the Sbox from AES and Feistel network from DES.
https://github.com/ilovenooodles/design-block-cipher
aes block-cipher cipher feistel
Last synced: about 2 months ago
JSON representation
Regina is a block cipher that created based on AES and DES and feistel network. It uses the Sbox from AES and Feistel network from DES.
- Host: GitHub
- URL: https://github.com/ilovenooodles/design-block-cipher
- Owner: IloveNooodles
- Created: 2023-02-27T17:50:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-26T09:00:42.000Z (about 2 years ago)
- Last Synced: 2025-02-06T08:44:36.393Z (4 months ago)
- Topics: aes, block-cipher, cipher, feistel
- Language: Python
- Homepage:
- Size: 609 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# design-block-cipher
IES is a block cipher that created based on AES and DES and feistel network. It uses the Sbox from AES and Feistel network from DES.
| NIM | Name |
| :------: | :----------------------------: |
| 13520029 | Muhammad Garebaldhie ER Rahman |
| 13520163 | Frederik Imanuel Louis |
| 13520166 | Raden Rifqi Rahman |## How does IES work
Generally IES have 5 components
1. Sbox
2. Pbox
3. Expansion Matrix
4. Round function
5. Key Generation## Requirements
1. Python 3.10
2. virtualenv## How to install
1. Make sure you have all the [requirements](#requirements) installed.
2. Create virtualenv by using `virtualenv venv`
3. Use the virtualenv by using
1. Windows: `./venv/Scripts/activate`
2. UNIX: `source ./venv/bin/activate`
4. Install all the requirements using `pip3 install -r requirements.txt`## How to run
```
usage: encrypt.py/decrypt [-h] [-M MODE] [-iv initial-vector-file] [-o output-vector-file] filepath key-file-or-phrasepositional arguments:
filepath
key-file-or-phraseoptional arguments:
-h, --help show this help message and exit
-M MODE, --mode MODE
-iv initial-vector-file
-o initial-vector-file, --outfile initial-vector-file
```1. `-M mode` is consisting of `ECB, CBC, CFB, OFB, CTR` other than that it will fails
2. `-iv path` is filepath consisting of the iv the program want to use. The file might be anything `.txt`, `.in` or no exstention. The files is consisting bytes or text. `iv` options will be used for all modes except `ECB`This is example of `iv` file
```md
akusukamakaniyayayaya
```3. `-o output` is the filename that you want to output, the default is it will append `encrypted-` to the filename so if the filename is `a.txt` the result will be `encrypted-a.txt`
4. `filepath` file you want to `encrypt` or `decrpyt`
5. `key-file-or-phrase` the key that will be used for the process, might be phrase or from fileExample:
1. Encrypt file named `requirements.txt` using `ECB` mode with `key` from stdin```bash
python .\src\encrypt.py -M ecb .\requirements.txt akusukakripto
```2. Encrypt file named `requirements.txt` using `CBC` mode and `iv` file with `key` from stdin
```bash
python .\src\encrypt.py -M cbc -iv .\iv .\requirements.txt akusukakripto
```3. Decrypt file named `requirements.txt` using `CBC` mode and `iv` file with `key` from `a` file
```bash
python .\src\decrypt.py -M cbc -iv .\iv .\encrypted-requirements.txt .\a
```4. Decrypt file named `requirements.txt` using `CBC` mode and `iv` file with `key` from `a` file with file name `gare`
```bash
python .\src\decrypt.py -M cbc -iv .\iv -o .\gare .\encrypted-requirements.txt .\a
```