#!/usr/bin/env bash
set -euo pipefail
plain="${1:-task5_plain.txt}"
outdir="${2:-task5_out}"
key="${3:-00112233445566778899aabbccddeeff}"
iv="${4:-0102030405060708090a0b0c0d0e0f10}"
mkdir -p "$outdir"
openssl enc -aes-128-ecb -e -in "$plain" -out "$outdir/task5_ecb.bin" -K "$key"
openssl enc -aes-128-cbc -e -in "$plain" -out "$outdir/task5_cbc.bin" -K "$key" -iv "$iv"
openssl enc -aes-128-cfb -e -in "$plain" -out "$outdir/task5_cfb.bin" -K "$key" -iv "$iv"
openssl enc -aes-128-ofb -e -in "$plain" -out "$outdir/task5_ofb.bin" -K "$key" -iv "$iv"
