Files
code-dumps/sh/bash-chacha20.sh
xpk 72f06362f8 NEW: bash-chacha20.sh
Script to encrypt file using chacha20
2025-04-23 09:35:26 +08:00

9 lines
257 B
Bash
Executable File

#!/bin/bash
# Replace key and iv with your random string. The following are examples of how to generate the strings.
key=$(openssl rand -hex 32)
iv=$(openssl rand -hex 16)
openssl enc -chacha20 -base64 -salt -md sha512 -in $1 -out $1.asc -K $key -iv $iv